After Logout Redirect to login page but click back button go to dashboard

Hi, I am create flutter login app. this app successfully login and logout. but before login directly dashboard page open, after logout dashboard page open.

After login correctly redirect to dashboard. But click back button go to again login page (without logout button click).

Use pushReplacement to navigate from login to dashboard and after clicking logout navigate to login page as below:
Navigator.pushReplacement(context, MaterialPageRoute(builder: (BuildContext context) => NewPage()));

1 Like