How to remove the hamburger button from a flutter drawer?

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...


Just set the leading property in your AppBar to an empty Container

appBar: new AppBar(
          leading: new Container(),
    ....

And in order to remove endDrawer (for RtL). It is placed where the action property is, so also just add an empty Container as a single child of the action property

appBar: new AppBar(
        actions: <Widget>[
          new Container(),
        ],
.....

Tags:

Flutter