flutter - 无靠背的颤振抽屉
问题描述
我想删除抽屉上的后退按钮
Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
ListTile(
leading: Icon(Icons.home),
title: Text ('Home'),
onTap: () {
Navigator.pop(context);
Navigator.push(context,
MaterialPageRoute(builder: (context) => HomePage(auth: widget.auth,userId: widget.userId,onSignedOut: this.widget.onSignedOut,)));
},
),
ListTile(
leading: Icon(Icons.exit_to_app),
title: Text('Log Out'),
onTap: () {
_signOut();
// Navigator.pop(context);
Navigator.of(context).pushReplacement(
new MaterialPageRoute(builder: (context) =>RootPage(auth: new Auth())
));
},
),
],
),
);
我想返回我的登录页面,没有应用栏上的后退按钮
解决方案
automaticallyImplyLeading: false
像这样添加AppBar
:
Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text("Title"),
),
drawer: Drawer(),
)
推荐阅读
- kotlin - 如何从主要活动访问位于适配器类中的变量
- node.js - CommonJS 和 ES6 模块如何包含在同一个 repo 中?
- linux - 我想通过 shell 删除所有文件,除了少数 as 但导致语法错误:“(”意外
- android - Linux 内核更新后设备的 IRQ 中断
- java - 我正在开发一个消息传递应用程序,代码与以前相同,但我不再获得所需的输出
- python - 在每日循环中使用 invoke()
- r - RMarkdown 不显示输出
- git - Git 工作流,级联变基,具有 2 个功能分支
- r - 试图将字符项编辑成一个句子
- dax - 按组划分的 DAX SUM DISTINCT 值