I am trying to return the user to the login page once they sign out from the app but goodness,nothing is working. I am getting exceptions like Bad state: Future already completed or the app returns to the login screen but the previous screen still exists in the stack when I hit back.
Here is my code:
_logOut() async{
await _auth.signOut().then((value){
print("***** log out");
//Navigator.pop(context);
//Navigator.popUntil(context, ModalRoute.withName("/login"));
Navigator.pushReplacement(context, new MaterialPageRoute(builder: (context)=>new MyApp()));
});
// Navigator.popUntil(context, ModalRoute.withName("/login"));
}