How to Remove the Hamburger Button From Flutter Drawer?

· 3 min read
How to Remove the Hamburger Button From a Flutter Drawer
How to Remove the Hamburger Button From a Flutter Drawer

In the native application, we were using Fragments and Drawer files for managing navigation but in flutter, there is quite a difference to create page routes. So in today’s article, we will go through how to Remove Hamburger Button From Flutter Drawer.

How to Remove the Hamburger Button From Flutter Drawer?

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

Now, just add an empty Container as a single child of the action property as it is placed where the action property is there.

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

Use the automaticallyImplyLeading property on the AppBar widget

For the end drawer you should do the following:

actions: [Container()]

In AppBar you need to do the following to hide the 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 the default rendering hamburger icon

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

Conclusion:

Thank you for reading the article!! we hope you have got the best of it!!

So in this article, we have been through how to Remove Hamburger Button From Flutter Drawer Stay tuned for related topics(tell us in the comments if you want articles on any specific topic).

Keep Learning !!! Keep Fluttering !!!

Don’t forget to drop your valuable feedback in the comments below!! Right now. Lots of informative and meaningful content coming up your way!!!

FlutterAgency.com is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget GuideFlutter ProjectsCode libs and etc.

FlutterAgency.com is one of the most popular online portals dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge of Flutter.

Leave a Reply