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. Centos7下安装ORACLE 11g,弹窗不显示

    Centos7下安装ORACLE 11gR2,弹窗不显示,安装界面显示为灰色. 解决方法:执行安装时带上一下参数 ./runInstaller -jreLoc /etc/alternatives/jr ...

  2. java面试题实战三

    华为优招面试经验. 1.笔试(这部分按照华为以前的风格不会为难人的,认真做AC一道题就可以进面试了,我编程能力一般吧,做了一道半而已,-_-||!) 2.测评(性格测试,不要太偏激就行了) 3.面试分 ...

  3. matlab学习笔记12_3串联结构体,按属性创建含有元胞数组的结构体,filenames,isfield,isstruct,orderfields

    一起来学matlab-matlab学习笔记12 12_3 结构体 串联结构体,按属性创建含有元胞数组的结构体,filenames,isfield,isstruct,orderfields 觉得有用的话 ...

  4. LeetCode_485. Max Consecutive Ones

    485. Max Consecutive Ones Easy Given a binary array, find the maximum number of consecutive 1s in th ...

  5. 爬虫笔记之teambition登录验证码

    一.缘起 想做的事情太多,计划乱糟糟,想找个工具理一下,想起来了的很久之前用过teambition,打算看一下,然后在登录界面看到一个比较有意思的验证码: 这种倒是比较有意思哈,看着像是模仿12306 ...

  6. 将博客转成pdf

    前些天无意间看到了“birdben”的博客,写的比较详细,但是最新的文章更新时间是“2017-05-07”,时间很是久远,本打算有时间认真学习一下博主所写的文章,但是担心网站会因为某些原因停止服务,于 ...

  7. SpringBoot系列教程web篇之自定义异常处理HandlerExceptionResolver

    关于Web应用的全局异常处理,上一篇介绍了ControllerAdvice结合@ExceptionHandler的方式来实现web应用的全局异常管理: 本篇博文则带来另外一种并不常见的使用方式,通过实 ...

  8. maven将Jar安装进仓库

    mvn install:install-file -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.4 -Dpac ...

  9. Math 类

    Math 类 java.lang.Object java.lang.Math 方法签名 public final class Math extends Object public static fin ...

  10. [转帖]70亿!以色列间谍产品公司NSO要被卖掉了

    70亿!以色列间谍产品公司NSO要被卖掉了 2017-06-14 11:11 https://www.sohu.com/a/148739327_257305 E安全6月14日讯以色列的网络能力处于世界 ...