I am creating an app where I have complete manual control over every back button press.
I basically have widgets/views changing in my app instead of the Navigator pushing and popping new screens.
I created a function where I am able to display views 1,2 and 3. and go back using the back button on android. however in case of iOS the back gesture does not work and I am unable to change views.
any workaround? Help would be appreciated
Future<bool> goBackward(){
if(_isButtonPressed) {
if(currentView == 0)
{
return Future<bool>.value(true);
}
else if(currentView == 1)
{
currentView = 0;
notifyListeners();
return Future<bool>.value(false);
}
else
{
currentView = 2;
notifyListeners();
return Future<bool>.value(false);
}
}
}
above is minimal version of code. when I return true that means I'm ready to Pop screen on back press