mt-akar / bottom_nav_layout

A quick and powerful Flutter layout with a bottom navbar.
https://pub.dev/packages/bottom_nav_layout
MIT License
34 stars 11 forks source link

How to open a screen without the Nav bar. #4

Closed ajsatam closed 3 years ago

ajsatam commented 3 years ago

How do you navigate to a page without a nav bar. From a screen/widget which has nav bar. Is this possible?

When I try to open a new screen it always open in the nav bar.

mt-akar commented 3 years ago

Assumption: You are using a navigator widget as part of your page widget tree. When you push a something, you are pushing to this navigator. This results in bottom bar staying visible.

Reminder: MaterialApp widget contains a navigator widget. (For detailed info, check out MaterialApp's documentation.)

What you want to do is to push to the root navigator provided by the Material app, not to the one you created yourself.

Solution: Check out this SO post https://stackoverflow.com/questions/55213680/in-a-nested-navigator-structure-of-flutter-how-do-you-get-the-a-specific-naviga

Kindly, tell me the results after you try this. Have a good day.