Here I have face a issue on BottomNavBar widget, When I try to navigate next screen the bottomNavBar will be hide
, But I want like this video........ ==>
BottomNavBar Always show , When navigate or not. I mean I want it permanent...Anyone help me please......
(Video for better understanding)
Please check this video to understand easily , What I expect......
Take Love.......
Here Is My NavBarWidget Code:...
class BottomBarHome extends StatefulWidget {
const BottomBarHome({Key? key}) : super(key: key);
@override
_BottomBarHomeState createState() => _BottomBarHomeState();
}
class _BottomBarHomeState extends State<BottomBarHome> {
int _currentTab = 1;
final PageStorageBucket bucket = PageStorageBucket();
Widget _currentScreens = HomePage();
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
body: PageStorage(
bucket: bucket,
child: _currentScreens,
),
bottomSheet: BottomAppBar(
// color: white,
elevation: 10,
// notchMargin: 10,
child: Container(
// height: 60,
child: Padding(
padding: paddingH20,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
setState(() {
_currentScreens = CustomDrawerNavigationBar();
_currentTab = 0;
});
},
child: Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
_currentTab == 0 ? Icons.menu : Icons.menu_outlined,
color: _currentTab == 0 ? green50 : black,
),
),
),
GestureDetector(
onTap: () {
setState(() {
_currentScreens = HomePage();
_currentTab = 1;
});
},
child: Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
_currentTab == 1 ? Icons.home : Icons.home_outlined,
color: _currentTab == 1 ? green50 : black,
),
),
),
GestureDetector(
onTap: () {
setState(() {
_currentScreens = StorePage(
isNavBarOpen: true,
);
_currentTab = 2;
});
},
child: Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
_currentTab == 2 ? Icons.store : Icons.store_outlined,
color: _currentTab == 2 ? green50 : black,
),
),
),
GestureDetector(
onTap: () {
setState(() {
_currentScreens = CartPage();
_currentTab = 3;
});
},
child: Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
_currentTab == 3
? Icons.shopping_cart
: Icons.shopping_cart_outlined,
color: _currentTab == 3 ? green50 : black,
),
),
),
GestureDetector(
onTap: () {
setState(() {
_currentScreens = ProfilePage();
_currentTab = 4;
});
},
child: Padding(
padding: EdgeInsets.all(8.0),
child: Icon(
_currentTab == 4 ? Icons.person : Icons.person_outline,
color: _currentTab == 4 ? green50 : black,
),
),
),
],
),
),
),
),
),
);
}
}