Home > Back-end >  How to hide bottom tab navigator (persistent_bottom_nav_bar) when the screen is not the main screens
How to hide bottom tab navigator (persistent_bottom_nav_bar) when the screen is not the main screens

Time:01-04

I am currently using persistent_bottom_nav_bar: ^4.0.2 package of flutter which showing 3 screens (A,B,C screens) in the bottom tab navigator. In the first screen I have a button that navigate user to another screen (D screen). The problem is the bottom tab navigator (persistent_bottom_nav_bar) is still showing in D screen, while the main screens are AB,C. Is there a way to hide persistent_bottom_nav_bar when the screen is not one of three main screen ?

CodePudding user response:

You use persistent_bottom_nav_bar which is worthless if you don't want bottom bar in all your screens. You can use simple bottomNavigationBar of Scaffold property. It will work.

CodePudding user response:

can you check persistent_bottom_nav_bar in example code.

onScreenHideButtonPressed: () {
          setState(() {
            _hideNavBar = !_hideNavBar;
          });
        },
  •  Tags:  
  • Related