1

I'm using the Persistent bottomnavbar because I need the bottom navbar to be always showing on all pages in my application. https://pub.dev/packages/persistent_bottom_nav_bar

It is working fine generally but it has a problem of creating multiple bottomnavbar when I'm done with a page and navigating to another page using the pushAndRemoveUntil method:

Navigator.pushAndRemoveUntil(
                context,
                MaterialPageRoute(builder: (context) => MyApp()),
                ModalRoute.withName("/Home"));

or using the pushReplacement method:

Navigator.pushReplacement(context,
              MaterialPageRoute(builder: (context) => MyHomePage()));

I think this is happening because the page I'm navigating to already had a bottom_navbar and when navigating to it; I'm adding another instance of the same page, which resulting in multiple navbar.

It is very important for cases like logout. I know this possible with the normal bottom_navigation_bar but how can I do this with the persistent_bottom_navbar where I need to drop and erase all previous pages when navigating and only keep the page I want to go to, and prevent having multiple bottomnavbar.

I couldn't attach a picture because of an error; so this is the picture link showing the problem: https://raw.githubusercontent.com/salarazad/persistent_nav_bar/main/persistent_bottom_navbar.jpeg

Salar Azad
  • 41
  • 2
  • 9

0 Answers0