import 'package:flutter/material.dart';

main() => runApp(MaterialApp(
home: HomePage(),
)); class HomePage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return HomePageState();
}
} class HomePageState extends State<HomePage> {
double w, h;
double page;
double draw = 0.0;
double i = 50;
bool ini = true; @override
Widget build(BuildContext context) {
w = MediaQuery.of(context).size.width;
h = MediaQuery.of(context).size.height; if(ini) {
page = w;
ini = !ini;
} return SafeArea(
child: Scaffold(
body: Container(
width: w, height: h,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(color: Colors.black, width: draw,),
Container(
width: page,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(color: Colors.amberAccent,child: Text('atest'),)),
),
],
),
),
floatingActionButton: FloatingActionButton(onPressed: (){
setState(() {
draw = w * 3/5;
page = w * 2/5;
});
}),
),
);
}
}

  

custom drawer的更多相关文章

  1. WebRTC中Android Demo中的远程视频流的获取到传输

    1.CallActivity#onCreate 执行startCall开始连接或创建房间 2.WebSocketClient#connectToRoom 请求一次服务器 3.回调到CallActivi ...

  2. Android Navigation Drawer,自定义ActionBar(标题居中)

    整个示例都是改造自 Google Android Training 中的 NavigationDrawer 示例(http://developer.android.com/training/imple ...

  3. Drawer Layout

    http://developer.android.com/training/implementing-navigation/nav-drawer.html#DrawerLayout <menu ...

  4. Android UI开发第三十三篇——Navigation Drawer For Android API 7

    Creating a Navigation Drawer中使用的Navigation Drawer的android:minSdkVersion="14",现在Android API ...

  5. Android Navigation Drawer(导航抽屉)

    Google I/O 2013 Android 更新了Support库,新版本的Support库中新加入了几个比较重要的功能. 添加 DrawerLayout 控件,支持创建  Navigation ...

  6. Unity编辑器扩展-Custom List, displaying data your way

    本文转自http://catlikecoding.com/unity/tutorials/editor/custom-list/ Custom List, displaying data your w ...

  7. AutoMapper:Unmapped members were found. Review the types and members below. Add a custom mapping expression, ignore, add a custom resolver, or modify the source/destination type

    异常处理汇总-后端系列 http://www.cnblogs.com/dunitian/p/4523006.html 应用场景:ViewModel==>Mode映射的时候出错 AutoMappe ...

  8. Spring Enable annotation – writing a custom Enable annotation

    原文地址:https://www.javacodegeeks.com/2015/04/spring-enable-annotation-writing-a-custom-enable-annotati ...

  9. SharePoint2013 Set a custom application page as site welcome page

    本文主要介绍如何添加一个custom application page as site welcome page 1.首先创建一个sharepoint 2013 empty solution, add ...

随机推荐

  1. Mongodb聚合 时间分组(转载)

    // Requires official MongoShell 3.6+ use MediaNetDB; db.getCollection("TestCollection").ag ...

  2. 蓝牙BLE: 蓝牙(BLE)协议栈

    蓝牙协议是通信协议的一种,一般而言,我们把某个协议的实现代码称为协议栈(protocol stack),BLE协议栈就是实现低功耗蓝牙协议的代码,理解和掌握BLE协议是实现BLE协议栈的前提.当前的蓝 ...

  3. SwiftUI or Flutter ?

    看到这篇好文,忍不住想分享一下 本文转自https://juejin.im/post/5d05b45bf265da1bcc193ff4 版权归原文所有 ------------------------ ...

  4. [转]iview的render函数用法

    原文地址:https://www.jianshu.com/p/f593cbc56e1d 一.使用html的标签(例如div.p) 原生标签用法 二.使用iview的标签(例如Button) iview ...

  5. Oracle系列十四 序列、索引和同义词

    序列 : 提供有规律的数值.索引  : 提高查询的效率同义词  :给对象起别名 序列: 可供多个用户用来产生唯一数值的数据库对象 自动提供唯一的数值 共享对象 主要用于提供主键值 将序列值装入内存可以 ...

  6. Holmos框架

    一.Holmos介绍--简介 Holmos-webtest是一个居于selenium2.0二次封装的开源框架,采用Page-Object模式去组织页面结构,同时支持多维度的页面元素定位方式,同时还继承 ...

  7. Indellij IDEA的菜单 File Edit View等主菜单栏不小心删除,恢复的解决办法

    修改以后保存,重启Idea

  8. js 动态加载 jq

    var script=document.createElement("script"); script.type="text/javascript"; scri ...

  9. matlab学习笔记11_3高维数组操作 filp, shiftdim, size, permute, ipermute

    一起来学matlab-matlab学习笔记11 11_3 高维数组处理和运算 filp, shiftdim, size, permute, ipermute 觉得有用的话,欢迎一起讨论相互学习~Fol ...

  10. Linux 提示更新密码

    You are required to change your password immediately (password aged)Last login: Thu Aug 22 17:04:01 ...