我要删除抽屉上的后退按钮
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())
));
},
),
],
),
);
我想返回我的登录页面,而没有应用栏上的后退按钮
答案 0 :(得分:1)
像这样将automaticallyImplyLeading: false
添加到AppBar
:
Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
title: Text("Title"),
),
drawer: Drawer(),
)