This commit is contained in:
parent
9fd5b7c03f
commit
143a41588f
@ -26,7 +26,15 @@ class _AuthScreenState extends State<AuthScreen> {
|
|||||||
body: Consumer<Auth>(
|
body: Consumer<Auth>(
|
||||||
builder: (context, auth, _) {
|
builder: (context, auth, _) {
|
||||||
if (auth.authenticated) {
|
if (auth.authenticated) {
|
||||||
Navigator.of(context).pushReplacementNamed('/');
|
Future.delayed(Duration(milliseconds: 1), () {
|
||||||
|
if (constants.navigatorKey.currentContext == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Navigator.of(
|
||||||
|
constants.navigatorKey.currentContext!,
|
||||||
|
).pushNamedAndRemoveUntil('/', (Route<dynamic> route) => false);
|
||||||
|
});
|
||||||
return SizedBox.shrink();
|
return SizedBox.shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user