BilalShahid13 / PersistentBottomNavBar

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

when using onwillpop, with handleAndroidBackButtonPress=false, it gives #315

Open hadiabdullan opened 1 year ago

hadiabdullan commented 1 year ago

type 'Future' is not a subtype of type '(() => Future)?' in type cast

hadiabdullan commented 1 year ago

when using onwillpop, with handleAndroidBackButtonPress=false, it gives type 'Future' is not a subtype of type '(() => Future)?' in type cast

AndreSait commented 1 year ago

Change the onWillPop to this:

onWillPop: !widget.handleAndroidBackButtonPress && widget.onWillPop != null ? () async { final result = await widget.onWillPop!(_contextList[_controller!.index]); return Future.value(result); }