颤抖抽屉无背

时间:2019-10-03 10:05:18

标签: 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())
                     ));
                    },
                  ),
                ],
              ),
        );

我想返回我的登录页面,而没有应用栏上的后退按钮

1 个答案:

答案 0 :(得分:1)

像这样将automaticallyImplyLeading: false添加到AppBar

Scaffold(
  appBar: AppBar(
    automaticallyImplyLeading: false,
    title: Text("Title"),
  ),
  drawer: Drawer(),
)