我使用endDrawer将抽屉添加到我的项目中,以便将其放置在右侧。当我拉动抽屉时,将显示应用栏箭头,并将其他应用栏内容推向右侧。
已经搜索了一些线程。我使用 Navigator.pushReplacement(...( 进入仪表板。尝试将仪表板也设置为主页,因为我认为这是一个导航的东西,但无济于事 !
endDrawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
Container(
height: 300,
child: DrawerHeader(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
"assets/avatar.png",
width: 90,
),
),
Padding(
padding: const EdgeInsets.all(5.0),
child: Text("Sample Name",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white)),
),
Text("sample@mail.com",
style: TextStyle(fontSize: 16, color: Colors.white)),
// Text()
],
),
decoration: BoxDecoration(
color: Colors.blueAccent,
),
),
),
ListTile(
leading: Icon(Icons.info),
title: Text('About'),
onTap: () {
// Update the state of the app
// ...
// Then close the drawer
Navigator.pop(context);
},
),
ListTile(
leading: Icon(Icons.lock),
title: Text('Privacy Policy'),
onTap: () {
// Update the state of the app
// ...
// Then close the drawer
Navigator.pop(context);
},
),
],
),
),
我需要删除应用栏上显示的箭头
在应用栏中插入此内容
AppBar (
automaticallyImplyLeading: false,
...
)