Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the hamburger button from a flutter drawer?

Tags:

flutter

I've seem examples on how to set up a drawer in Flutter (return new Scaffold(drawer: new Drawer( ... ) or return new Scaffold(endDrawer: new Drawer( ... )).

How can I remove the hamburger button at the top (so that you can only get the drawer through sliding from the side (or through a custom button in the app - that I know how to do))?

like image 783
Charles Shiller Avatar asked Feb 28 '18 16:02

Charles Shiller


1 Answers

In AppBar you need to do the following to hide default rendering hamburger icon

AppBar(
  automaticallyImplyLeading: false, // this will hide Drawer hamburger icon
  actions: <Widget>[Container()],   // this will hide endDrawer hamburger icon
  ... // other props
),

and In SilverAppBar do the following to hide default rendering hamburger icon

SilverAppBar(
  automaticallyImplyLeading: false, // this will hide Drawer hamburger icon
  actions: <Widget>[Container()],   // this will hide endDrawer hamburger icon
  ... // other props
}

I hope this will help...

like image 184
Aravind Vemula Avatar answered Sep 29 '22 21:09

Aravind Vemula