[英]Flutter - Remove drawer icon in scaffold
i'm trying to remove the burger drawer icon in flutter, but I don't find any solution.我试图删除 flutter 中的汉堡抽屉图标,但我没有找到任何解决方案。 I don't have an appbar, so I can't hide it changing leading attribute.
我没有应用栏,所以我无法隐藏它改变的主要属性。 This is my code:
这是我的代码:
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
drawer: Drawer(
child: Container()
),
body: Container()
),
);
}
在 App bar 中将 automaticallyImplyLeading 属性设置为 false 并且它不会出现
I just find out what was happening.我只是知道发生了什么。 It was not a Scaffold problem, it happened when I added an AppBar.
这不是 Scaffold 问题,是在我添加 AppBar 时发生的。 I didn't have one in the Scaffold, but inside it I have an NestedScrollView where I used and SliverAppBar that created that icon, you can easily hide it by using:
leading: Container()
inside any appbar我在 Scaffold 中没有一个,但在里面我有一个 NestedScrollView 和创建该图标的 SliverAppBar,您可以使用以下方法轻松隐藏它:
leading: Container()
inside any appbar
If you are using drawer use this line to hide inside AppBar() widget如果您使用的是抽屉,请使用此行隐藏在 AppBar() 小部件内
automaticallyImplyLeading: false,
and if you are using end drawer use it如果您使用的是末端抽屉,请使用它
actions: <Widget>[Container()],
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.