custom drawer
Posted pythonclub
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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( 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的主要内容,如果未能解决你的问题,请参考以下文章
在 Navigation Drawer 的每个片段中实现不同的 Action Bar 项
Android Drawer - 使用 Navigation.findNavController() 导航到多个片段
java 导航抽屉切换活动而不是片段。字体:https://stackoverflow.com/questions/19442378/navigation-drawer-to-switch-
Android Navigation Drawer Show Up Indicator for Lower Level Fragments