After clicking the logout button from home I am using the below line to navigate to the login screen. But after navigating to the login screen, if I click the back button it is navigating to the home screen. I want all screens to pop and the app should close if I click the back button from the login screen.
Both the lines didn't work for me. Help if someone knows this... Navigator.of(context).pushReplacementNamed(LOGIN); Navigator.of(context).pushNamedAndRemoveUntil(LOGIN, (route) => false);