with this: handleAndroidBackButtonPress: true, // Default is true.
it will always return to 0 index, but I want it to return to my initial index of 2 and not 0 when I press back. I could do that in the onwillpop function but it's not working, as It causes an error:
_AssertionError ('package:persistent_bottom_nav_bar/persistent_tab_view.widget.dart': Failed assertion: line 49 pos 16: '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.)
with this: handleAndroidBackButtonPress: true, // Default is true.
it will always return to 0 index, but I want it to return to my initial index of 2 and not 0 when I press back. I could do that in the onwillpop function but it's not working, as It causes an error: _AssertionError ('package:persistent_bottom_nav_bar/persistent_tab_view.widget.dart': Failed assertion: line 49 pos 16: '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.)