BilalShahid13 / PersistentBottomNavBar

A highly customizable persistent bottom navigation bar for Flutter
BSD 3-Clause "New" or "Revised" License
507 stars 368 forks source link

Get.back() not working #326

Open NaarGes opened 1 year ago

NaarGes commented 1 year ago

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,
    );
  }
EmmanyTaskWorld commented 1 year ago

You need to use Navigator.pop(context)