Why AppBar's automaticallyImplyLeading has no effect?

Viewed 646
AppBar(
  automaticallyImplyLeading: false, // Has no impact of true/false
  title: Text('AppBar'),
)

Docs mention:

automaticallyImplyLeading: If true and leading is null, automatically try to deduce what the leading widget should be. If false and leading is null, leading space is given to title.

In my code, leading is null but setting automaticallyImplyLeading property has no effect on the title. But docs say something else.

1 Answers

automaticallyImplyLeading: false used for removing the back button, from the second screen(This comes when the user navigates from the first screen to the second screen, which is the flutter default behavior). To show back button/leading widget flutter occupy some space at the left side of AppBar.

If false and leading is null, leading space is given to title.

As per the above statement, if it is false then, the default space of the leading widget/back button given to the title widget of App Bar.

appBar: AppBar(
        automaticallyImplyLeading: false, // Remove back button
        title: const Text('This is simple Text of App Bar for second screen'),
      ),

With automaticallyImplyLeading: false,

enter image description here

Related