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;
              });
            }),
          ),
        );
      }
    }
    

      

  • 相关阅读:
    java 寒假作业
    java 搭积木
    java 移动距离
    java 垒骰子
    java 饮料换购
    java 牌型种数
    ONOS基础教程(QuickStart with a VM)
    Java中 VO、 PO、DO、DTO、 BO、 QO、DAO、POJO的概念
    PM2使用基本介绍
    nodejs项目部署
  • 原文地址:https://www.cnblogs.com/pythonClub/p/11022927.html
Copyright © 2011-2022 走看看