feat: reflected changes from supabase_flutter v0.2.9 (#3822)

This commit is contained in:
Tyler authored and GitHub committed 2021-11-07 13:22:22 +08:00
1 parent ed67f16040
commit 6ea6c98867
1 file changed
+4 -7
+4 -7
View File
@@ -299,7 +299,10 @@ class AuthRequiredState<T extends StatefulWidget>
@override
void onUnauthenticated() {
/// Users will be sent back to the LoginPage if they sign out.
Navigator.of(context).pushNamedAndRemoveUntil('/login', (route) => false);
if (mounted) {
/// Users will be sent back to the LoginPage if they sign out.
Navigator.of(context).pushNamedAndRemoveUntil('/login', (route) => false);
}
}
}
```
@@ -527,7 +530,6 @@ class _AccountPageState extends AuthRequiredState<AccountPage> {
if (error != null) {
context.showErrorSnackBar(message: error.message);
}
Navigator.of(context).pushReplacementNamed('/login');
}
@override
@@ -538,11 +540,6 @@ class _AccountPageState extends AuthRequiredState<AccountPage> {
}
}
@override
void onUnauthenticated() {
Navigator.of(context).pushReplacementNamed('/login');
}
@override
void dispose() {
_usernameController.dispose();