I used willPopScope but doesn’t work. Has anybody any other idea what can I use to overwrite the default back button of Android in Android Studio
The actual result: When I click the back button, it redirects to the login page, not to the page I want.
Does anybody has any other idea about this to function?
2
Answers
It did not work. I have used this method with the route name:
.....
You may consider using a route system to avoid this behavior as follows: Navigate with named routes
or check out if you’re in Stateful widget as this is suggested in this previous answer
Hope this helps.