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. vs2017+qt5.x编译32位应用<转>

    原文地址:https://www.cnblogs.com/woniu201/p/10862170.html 概述 最近有同学私信我,问如何使用vs2017+qt5.10编译出32位的应用,需要使用ms ...

  2. DVT JetBrains License Server(JetBrains授权服务器)2018 v1.1 最新版 含32位/64位

    DVT JetBrains License Server是JetBrains系列软件授权服务器,支持2017版本得jetbrains pycharm,JetBrainswebstorm,JetBrai ...

  3. kotlin基础 range

    a = 1..10 //[1,10] b = 1 unitl 10 //[1,10)

  4. 【452】pandas筛选出表中满足另一个表所有条件的数据

    参考:pandas筛选出表中满足另一个表所有条件的数据 参考:pandas:匹配两个dataframe 使用 pd.merge 来实现 on 表示查询的 columns,如果都有 id,那么这是很好的 ...

  5. 5中I/O模型

    输入操作包括两个阶段1.等待网络数据到达,被复制到内核中的缓冲区2.从内核缓冲区复制到进程缓冲区5种I/O模型1.阻塞式I/O:包含数据被复制到内核缓冲区和应用进程缓冲区两个过程,调用recvfrom ...

  6. [Golang] mynats(对nats.go的二次封装)

    0x0 前言 最近项目开始使用nats作为消息中间件. nats的引入确实解决项目很多痛点. 比如: 1)服务动态横向扩展 2)负载均衡(nats的均衡机制只有随机,不过对我们来说也够用了) 3)多服 ...

  7. Centos7快速安装Rancher

    通过docker,我们可以快速安装rancher 安装步骤如下:[root@localhost ~]# #run运行,-d后台模式 --restart=always跟随docker启动,-p映射端口, ...

  8. 【ARM-Linux开发】Makefile 使用总结

    Makefile 使用总结 1. Makefile 简介 Makefile 是和 make 命令一起配合使用的. 很多大型项目的编译都是通过 Makefile 来组织的, 如果没有 Makefile, ...

  9. 【转】Object.keys方法之详解

     一.语法 Object.keys(obj) 参数:要返回其枚举自身属性的对象 返回值:一个表示给定对象的所有可枚举属性的字符串数组 二.处理对象,返回可枚举的属性数组 let person = {n ...

  10. zuul重连配置

    #retry #该参数用来开启重试机制 spring.cloud.loadbalancer.retry.enabled=true #断路器的超时时间,断路器的超时时间需要大于ribbon的超时时间,不 ...