0

I am building an app(Learning) and on first use the app it show authentication page with login and signup button if user click any one button and fill the fields it will be navigate to homePage.

Navigation :
Authentication Page=>login=>main page

Now the problem is I don't want users to get back to login page if they press back button on home page. Instead I want to exit the app. How can I do it?

1 Answer 1

1

When you navigate from login to main page use Navigator method .pushReplacement() instead of .push() and that will replace the login page on Navigator stack. Which means that the main page will be the only one on the stack. Pressing the back button or calling method .pop(), in that case, will close the application.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.