New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 [firebase_ui_auth] Null check operator used on a null value at EmailVerificationController.user(email_verification.dart:68) #9
Comments
Updated the flutter doctor and plugin is as follows: firebase_ui_auth:
dependency: "direct main"
description:
name: firebase_ui_auth
sha256: e439571fcad7ed48450eed8d64c70b93765526b876327055469806a51101eff0
url: "https://pub.dev"
source: hosted
version: "1.6.2" |
I have looked at the |
Thanks for the update. I tried with the plugin example running on latest master version, registered new user, received email, verified but when clicked continue, I got dynamic link error, but while waiting to confirm, I didn't the reported error: Are there any exact steps or if you could provide a short video when the error triggers would be good to make this issue actionable. |
I suppose the question is, what is the expected behaviour here? Once the user verifies email, should it automatically proceed to the next screen? Or does the user have to sign in again or change resume state? When you verified email, what happened on screen? I will try producing the error locally. |
Hi @mfizz1, have you been able to reproduce this locally? I used the plugin example app to do a registration and I was able to register without any issues. As to what is supposed to happen when you verify your email, it depends on how you've setup your Auth States but with the plugin example app, you will be redirected to the profile page (and based on what I see in your code sample, the same thing should happen) |
This is where it seems to be an issue. Whilst I am able to replicate the issue, in terms of the behaviour, it's not flagging up any issues. The only way I am able to proceed to the screen after email verification, is to cycle to another app and back into this one. Which triggers something to go to profile page. Otherwise I'm waiting with the circular progress indicator. I will try again today. |
I still haven't managed to produce the null error locally. But I noticed noticed a lot more things. Something to do with resuming from a paused state / cycling back the app. One of the other errors produced was: ════════ Exception caught by foundation library ════════════════════════════════
The following assertion was thrown while dispatching notifications for EmailVerificationController:
setState() called after dispose(): __EmailVerificationScreenContentState#a7daf(lifecycle state: defunct, not mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().
When the exception was thrown, this was the stack
#0 State.setState.<anonymous closure>
firebase/flutterfire#1 State.setState
firebase/flutterfire#2 __EmailVerificationScreenContentState._sendEmailVerification.<anonymous closure>
firebase/flutterfire#3 ChangeNotifier.notifyListeners
firebase/flutterfire#4 ValueNotifier.value=
firebase/flutterfire#5 EmailVerificationController.reload
<asynchronous suspension>
The EmailVerificationController sending notification was: EmailVerificationController#72e1b(EmailVerificationState.verified)
════════════════════════════════════════════════════════════════════════════════ I am sure it must be related as the user cycles back to and from the app when switching to email client |
@mfizz1 Based on the error report, I am going ahead and labeling for team's attention and input. /cc @lesnitsky |
One thing that definitely isn't happening for me is the automatically proceeding to the next screen until the user cycles the app or signs out or signs in again. I have had several users reporting the same issue. |
I am facing the exact issue. After a user registers, they are taken to the Email Verification Screen. The loader runs to instruct the user to click on the link in the verification email. The user does click the link, but no event is fired in the app, and the user never moves past that verification screen until manually signing out and signing in. My StreamBuilder code is as follows: StreamBuilder<User?>(
stream: _auth.authStateChanges(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
// Loading indicator or splash screen while checking authentication status.
return const CircularProgressIndicator();
}
final user = snapshot.data;
if (user == null) {
// User is not signed in, show the SignInScreen().
return SignInScreen(
providers: [EmailAuthProvider()],
);
} else {
if (!user.emailVerified) {
// User is signed in but email is not verified, show EmailVerificationScreen().
return EmailVerificationScreen(auth: _auth);
} else {
// User is signed in and email is verified, show ProfileScreen().
return const ProfileScreen();
}
}
},
), where |
Hey! Have you got the solution... I am facing the same problem? |
Bug report
Describe the bug
Getting a null check operator error when user registers for the first time and is then sent to email verification screen, waiting to verify their email. When the error occurs I get a varied response from the UI sometimes a blank screen, pressing back brings them back to login screen.
Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
Continue waiting for user to verify email
Sample project
This is what I use for my registration screen:
Additional context
Error Details:
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: