zoukankan      html  css  js  c++  java
  • custom drawer

    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(
               w, height: h,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: <Widget>[
                  Container(color: Colors.black,  draw,),
                  Container(
                     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;
              });
            }),
          ),
        );
      }
    }
    

      

  • 相关阅读:
    elipse图标注解
    Thrift源码解析--transport
    IDL和生成代码分析
    thrift概述
    less分页阅读
    this与super使用总结(java)
    more分页阅读
    Arrays
    Teigha克隆db的blockTableRecord里面的一个实体
    Teigha的BlockTableRecord获取方法
  • 原文地址:https://www.cnblogs.com/pythonClub/p/11022927.html
Copyright © 2011-2022 走看看