Fix Navigation issue where popping 2 routes at the same time (#584)

This commit is contained in:
Omar Hatem 2022-11-02 19:11:53 +02:00 committed by GitHub
parent 65dfb83a27
commit e8b3a0648a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,15 +111,16 @@ class AuthPageState extends State<AuthPage> {
throw Exception('Key context is null. Should be not happened');
}
WidgetsBinding.instance.addPostFrameCallback((_) async {
await _authBar?.dismiss();
await _progressBar?.dismiss();
if (route != null) {
Navigator.of(_key.currentContext!).pushReplacementNamed(route);
} else {
Navigator.of(_key.currentContext!).pop();
}
WidgetsBinding.instance.addPostFrameCallback((_) {
dismissFlushBar(_authBar);
dismissFlushBar(_progressBar);
WidgetsBinding.instance.addPostFrameCallback((_) {
if (route != null) {
Navigator.of(_key.currentContext!).pushReplacementNamed(route);
} else {
Navigator.of(_key.currentContext!).pop();
}
});
});
}