From 6ea6c988677b6050bb4ba5954c8bfe682f120fcc Mon Sep 17 00:00:00 2001 From: Tyler <18113850+dshukertjr@users.noreply.github.com> Date: Sun, 7 Nov 2021 14:22:22 +0900 Subject: [PATCH] feat: reflected changes from supabase_flutter v0.2.9 (#3822) --- web/docs/guides/with-flutter.mdx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/web/docs/guides/with-flutter.mdx b/web/docs/guides/with-flutter.mdx index c7534953388..e98b7082bd1 100644 --- a/web/docs/guides/with-flutter.mdx +++ b/web/docs/guides/with-flutter.mdx @@ -299,7 +299,10 @@ class AuthRequiredState @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 { if (error != null) { context.showErrorSnackBar(message: error.message); } - Navigator.of(context).pushReplacementNamed('/login'); } @override @@ -538,11 +540,6 @@ class _AccountPageState extends AuthRequiredState { } } - @override - void onUnauthenticated() { - Navigator.of(context).pushReplacementNamed('/login'); - } - @override void dispose() { _usernameController.dispose();