AppBar Widget or top App Bars is a collection of widget located at the top of the app, for wrapping our app’s title, icon, and action link. In today’s article, we will learn about How to Remove Back Button on AppBar in Flutter?
How to Remove Back Button on AppBar in Flutter ??
A simple way to remove the back button in the AppBar Widget is to set automaticallyImplyLeading to false.
automaticallyImplyLeading: This checks whether we want to apply the back widget leading widget over the app bar or not.
If the automaticallyImplyLeading is false then automatically space is given to the title and If the leading widget is true, then this parameter has no effect.
Code Snippet will look like below:
appBar: AppBar( title: Text("App Bar without Back Button"), automaticallyImplyLeading: false, ),
We will get output like below:
Use this code snippet for SliversAppBar
SliverAppBar ( automaticallyImplyLeading: false, elevation: 0, brightness: Brightness.light, backgroundColor: Colors.white, pinned: true, ),
Use this for normal AppBar Widget
appBar: AppBar( title: Text ("You decide on the appbar name" style: TextStyle(color: Colors.black,), elevation: 0, brightness: Brightness.light, backgroundColor: Colors.white, automaticallyImplyLeading: false, ),
In this article, we have learned about How to Remove Back Button on AppBar in Flutter ??
Thanks for Reading!!! Keep Learning!!! Keep Fluttering!!!
Also, want to learn about how to Hide FloatingActionButton In Flutter? Go check the article…
Do let us know if you need any assistance with Flutter Development?
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 Guide, Flutter Projects, Code 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.