Skip to content

Commit

Permalink
FIX Usage of BuildContext's across async gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
henry2man committed Jul 10, 2024
1 parent c9adcdd commit 6181863
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/components/supa_email_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,14 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
widget.onSignUpComplete.call(response);
}
} on AuthException catch (error) {
if (widget.onError == null && context.mounted) {
if (widget.onError == null && mounted) {
context.showErrorSnackBar(error.message);
} else {
widget.onError?.call(error);
}
_emailFocusNode.requestFocus();
} catch (error) {
if (widget.onError == null && context.mounted) {
if (widget.onError == null && mounted) {
context.showErrorSnackBar(
'${widget.localization.unexpectedError}: $error');
} else {
Expand Down Expand Up @@ -385,7 +385,7 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
);
widget.onPasswordResetEmailSent?.call();
// FIX use_build_context_synchronously
if (!context.mounted) return;
if (!mounted) return;
context.showSnackBar(widget.localization.passwordResetSent);
setState(() {
_isRecoveringPassword = false;
Expand Down

0 comments on commit 6181863

Please sign in to comment.