我在抽屉里有一个ListView,我希望它只构建一次。我知道它正在被处理,因为每次我关闭和重新打开抽屉时滚动位置都会重置,例如,打开抽屉,滚动到列表底部,关闭抽屉,重新打开它,你会明白我的意思。如何让它记住状态?这是一个最小的工作示例:import'package:flutter/material.dart';voidmain()=>runApp(MyApp());classMyAppextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){returnMaterialApp(title:'FlutterDemo'
我在抽屉里有一个ListView,我希望它只构建一次。我知道它正在被处理,因为每次我关闭和重新打开抽屉时滚动位置都会重置,例如,打开抽屉,滚动到列表底部,关闭抽屉,重新打开它,你会明白我的意思。如何让它记住状态?这是一个最小的工作示例:import'package:flutter/material.dart';voidmain()=>runApp(MyApp());classMyAppextendsStatelessWidget{@overrideWidgetbuild(BuildContextcontext){returnMaterialApp(title:'FlutterDemo'
我在Drawer的ListView中有一个ExpansionTile..我希望子标题直接在其主标题下对齐以下gif显示当前状态..Scaffold(appBar:AppBar(title:Text(title)),body:Center(child:Text('MyPage!')),drawer:Drawer(//AddaListViewtothedrawer.Thisensurestheusercanscroll//throughtheoptionsintheDrawerifthereisn'tenoughvertical//spacetofiteverything.child:Li
我在Drawer的ListView中有一个ExpansionTile..我希望子标题直接在其主标题下对齐以下gif显示当前状态..Scaffold(appBar:AppBar(title:Text(title)),body:Center(child:Text('MyPage!')),drawer:Drawer(//AddaListViewtothedrawer.Thisensurestheusercanscroll//throughtheoptionsintheDrawerifthereisn'tenoughvertical//spacetofiteverything.child:Li
我正在制作一个flutter应用程序,我需要能够通过点击BottomNavigationBarItem打开抽屉。有什么办法吗?UX设计师将抽屉菜单图标放在底部导航栏的索引0处。我试图在Flutter文档中找到答案,但没有找到任何相关内容。我实际上找到了一种以编程方式打开它的方法(如下所示),但在我的情况下它并不像那样工作。class_HomeStateextendsState{int_currentIndex=1;//0=menufinalList_children=[PlaceholderWidget(Colors.deepPurple),PlaceholderWidget(Colo
我正在制作一个flutter应用程序,我需要能够通过点击BottomNavigationBarItem打开抽屉。有什么办法吗?UX设计师将抽屉菜单图标放在底部导航栏的索引0处。我试图在Flutter文档中找到答案,但没有找到任何相关内容。我实际上找到了一种以编程方式打开它的方法(如下所示),但在我的情况下它并不像那样工作。class_HomeStateextendsState{int_currentIndex=1;//0=menufinalList_children=[PlaceholderWidget(Colors.deepPurple),PlaceholderWidget(Colo
我想通过容器中的按钮打开侧边抽屉,而不是通过AppBar侧边按钮。这也应该从右到左打开。有关更多信息,我添加了我的要求的屏幕截图 最佳答案 这里有一个基本示例:@overrideWidgetbuild(BuildContextcontext){returnScaffold(endDrawer:Drawer(),appBar:AppBar(),body:Builder(builder:(context){returnCenter(child:RaisedButton(child:Text("opendrawer"),onPressed
我想通过容器中的按钮打开侧边抽屉,而不是通过AppBar侧边按钮。这也应该从右到左打开。有关更多信息,我添加了我的要求的屏幕截图 最佳答案 这里有一个基本示例:@overrideWidgetbuild(BuildContextcontext){returnScaffold(endDrawer:Drawer(),appBar:AppBar(),body:Builder(builder:(context){returnCenter(child:RaisedButton(child:Text("opendrawer"),onPressed
这是我的代码,复制自here:SliverAppBar(expandedHeight:150.0,flexibleSpace:constFlexibleSpaceBar(title:Text('Availableseats'),),actions:[IconButton(icon:constIcon(Icons.add_circle),tooltip:'Addnewentry',onPressed:(){/*...*/},),])但是我需要添加一个Drawer。我该怎么做?我正在尝试在Flutter中重建我的应用程序。Convertingjavaandroidapptoflutter我
这是我的代码,复制自here:SliverAppBar(expandedHeight:150.0,flexibleSpace:constFlexibleSpaceBar(title:Text('Availableseats'),),actions:[IconButton(icon:constIcon(Icons.add_circle),tooltip:'Addnewentry',onPressed:(){/*...*/},),])但是我需要添加一个Drawer。我该怎么做?我正在尝试在Flutter中重建我的应用程序。Convertingjavaandroidapptoflutter我