PersistentBottomNavBar
PersistentBottomNavBar copied to clipboard
Get.back() not working
Hi,
I'm using the bottom navigation along side GetX package. when I use Get.back() to dismiss a drawer it doesn't work.
and when I set the handleAndroidBackButtonPress
to false and override onWillPop
myself I get the error:
If you declare the onWillPop function, you will have to handle the back function functionality yourself as your onWillPop function will override the default function.
this is my build method:
@override
Widget build(BuildContext context) {
return PersistentTabView(
context,
controller: _tabController,
screens: _pages,
items: _tabs(context),
confineInSafeArea: true,
handleAndroidBackButtonPress: false,
onWillPop: (_) async {
return true;
},
resizeToAvoidBottomInset: true,
stateManagement: true,
hideNavigationBarWhenKeyboardShows: true,
decoration: NavBarDecoration(
borderRadius: BorderRadius.circular(10.0),
colorBehindNavBar: Colors.white,
),
// popAllScreensOnTapOfSelectedTab: true,
// popActionScreens: PopActionScreensType.all,
itemAnimationProperties: const ItemAnimationProperties(
duration: Duration(milliseconds: 200),
curve: Curves.ease,
),
screenTransitionAnimation: const ScreenTransitionAnimation(
animateTabTransition: true,
curve: Curves.ease,
duration: Duration(milliseconds: 200),
),
navBarStyle:
NavBarStyle.style6,
);
}
You need to use Navigator.pop(context)