You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am pushing routes with Navigator to navigate between screens.
I have written the package code in my third route.
When I double back button press on the third route, it only takes me to my second route.
It only works on the first route.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered:
Although the name of the package is double_back_to_close_app, it actually provides a way to "double back to close the current route", so I'm not surprised about the experience you faced.
There's no way to safely close the app when you are not on the initial route, as you can see here. Therefore, the library behavior is correct.
Removing the previous routes may help you achieve what you want, though. Since you are not allowing the user to return to the previous route, it doesn't make any difference. So, instead of simply pushing the third route, consider these other methods:
Navigator.pushAndRemoveUntil()
Navigator.pushReplacement()
Navigator.removeRouteBelow()
I'm closing this for now, but feel free to open it again if my answer doesn't satisfy you :)
I am pushing routes with Navigator to navigate between screens.
I have written the package code in my third route.
When I double back button press on the third route, it only takes me to my second route.
It only works on the first route.
Am I doing something wrong?
The text was updated successfully, but these errors were encountered: