diff --git a/lib/persistent_tab_view.widget.dart b/lib/persistent_tab_view.widget.dart index e173c8b6..f26ac570 100644 --- a/lib/persistent_tab_view.widget.dart +++ b/lib/persistent_tab_view.widget.dart @@ -46,7 +46,9 @@ class PersistentTabView extends PersistentTabViewBase { "screens and items length should be same. If you are using the onPressed callback function of 'PersistentBottomNavBarItem', enter a dummy screen like Container() in its place in the screens"), assert(items!.length >= 2 && items.length <= 6, "NavBar should have at least 2 or maximum 6 items (Except for styles 15-18)"), - assert(handleAndroidBackButtonPress && onWillPop == null, + assert( + handleAndroidBackButtonPress && onWillPop == null || + !handleAndroidBackButtonPress && onWillPop != null, "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."), super( key: key, @@ -104,7 +106,9 @@ class PersistentTabView extends PersistentTabViewBase { this.screenTransitionAnimation = const ScreenTransitionAnimation(), }) : assert(itemCount == screens.length, "screens and items length should be same. If you are using the onPressed callback function of 'PersistentBottomNavBarItem', enter a dummy screen like Container() in its place in the screens"), - assert(handleAndroidBackButtonPress && onWillPop != null, + assert( + handleAndroidBackButtonPress && onWillPop == null || + !handleAndroidBackButtonPress && onWillPop != null, "If you declare the onWillPop function, you will have to handle the back function functionality yourself as your onWillPop function will override the defualt function."), super( key: key,