I need a drawer like this-> https://i.stack.imgur.com/TWT4H.jpg
This is my current code. I'm using persistent_bottom_nav_bar. I need to trigger the drawer from the bottom navigator bar last item. did anyone got any idea? If drawer can't be accessed from bottom navigation is there any other way I could replicate that UI. Thank you
class BottomNav extends StatefulWidget {
const BottomNav({Key? key}) : super(key: key);
@override
_BottomNavState createState() => _BottomNavState();
}
class _BottomNavState extends State<BottomNav> {
late PersistentTabController _controller;
@override
void initState() {
super.initState();
_controller = PersistentTabController(initialIndex: 0);
setState(() {});
}
List<Widget> _buildScreens() {
return [
HomePage(),
HistoryPage(),
ServicePage(),
ProfilePage(),
];
}
List<PersistentBottomNavBarItem> _navBarsItems() {
return [
PersistentBottomNavBarItem(
icon: Icon(Icons.home),
title: ("Home"),
textStyle: TextStyle(fontWeight: FontWeight.w700, fontSize: 10),
activeColorPrimary: themeBlue,
inactiveColorPrimary: greyColor,
),
PersistentBottomNavBarItem(
icon: Icon(Icons.history),
title: ("History"),
activeColorPrimary: themeBlue,
textStyle: TextStyle(fontWeight: FontWeight.w700, fontSize: 10),
inactiveColorPrimary: greyColor,
),
PersistentBottomNavBarItem(
icon: Icon(Icons.apps_outlined),
title: ("Services"),
activeColorPrimary: themeBlue,
textStyle: TextStyle(fontWeight: FontWeight.w700, fontSize: 10),
inactiveColorPrimary: greyColor,
),
PersistentBottomNavBarItem(
icon: Icon(CupertinoIcons.person_alt_circle),
title: ("Profile"),
activeColorPrimary: themeBlue,
inactiveColorPrimary: greyColor,
textStyle: TextStyle(fontWeight: FontWeight.w700, fontSize: 10),
),
];
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: PersistentTabView(
context,
controller: _controller,
screens: _buildScreens(),
items: _navBarsItems(),
confineInSafeArea: true,
backgroundColor: Colors.white,
handleAndroidBackButtonPress: true,
popAllScreensOnTapOfSelectedTab: true,
popActionScreens: PopActionScreensType.all,
itemAnimationProperties: ItemAnimationProperties(
duration: Duration(milliseconds: 200),
curve: Curves.ease,
),
screenTransitionAnimation: ScreenTransitionAnimation(
animateTabTransition: true,
curve: Curves.ease,
duration: Duration(milliseconds: 200),
),
navBarStyle:
NavBarStyle.style6, // Choose the nav bar style with this property.
),
);
}
}