[英]How to automatically show menu button when adding a drawer in flutter
I've added Drawer
to my flutter
application, but there is no menu button showing in the app bar to be responsible for opening it.我已将
Drawer
添加到我的flutter
应用程序中,但应用程序栏中没有显示菜单按钮来负责打开它。 I know I can do it programmatically but in the official documentation, it says it should be added automatically, but it is not showing for me我知道我可以通过编程方式做到这一点,但在官方文档中,它说它应该自动添加,但它没有显示给我
here is my code:这是我的代码:
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.deepOrangeAccent,
automaticallyImplyLeading: false,
),
drawer: Drawer(),
);
}
Just comment following line will solve your issue.只需评论以下行即可解决您的问题。
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.deepOrangeAccent,
// automaticallyImplyLeading: false,
),
drawer: Drawer(),
);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.