For faster navigation to root pages in deep navigation, both Back and Drawer icon buttons need to be shown in AppBar.
How to do that in a Flutter app?
The solution is quite simple. What you need to do is to set the leading argument of the AppBar widget to your custom widget (eg: an elevated button): appBar: AppBar( // Overide the default Back button automaticallyImplyLeading: false, leadingWidth: 100, leading: ElevatedButton. icon( onPressed: () => Navigator.
To change the drawer icon in Flutter, add an IconButton widget inside the leading property of the AppBar widget. Inside the IconButton you can set any icon of your choice. Then, inside the onPressed of an IconButton, you can write a method to open the drawer.
Wrap your toolbar widget with Row
....
Row toolbar = new Row(
children: <Widget>[
new Icon(Icons.arrow_back),
new Icon(Icons.menu),
new Expanded(child: new Text(widget.title)),
new Icon(Icons.arrow_forward)
]
);
return new Scaffold(
appBar: new AppBar(
title: toolbar,
),
....
Here it is the result
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With