This is about Flutter Firebase Authentication plugin.
I am trying to send a verification email after creating a new user, but sendEmailVerification() internally uses currentUser(). This looks like a bug to me, but just in case, I am posting a question to stackoverflow. The error is the same on Android and IOS.
First two lines return FirebaseUser. The third returns null. Forth, if third is commented throws a null reference error.
Thanks,
Boris
user = await _auth.createUserWithEmailAndPassword(email: email, password: password);
// result is FirebaseUser
user = await _auth.signInWithEmailAndPassword(email: email, password: password);
// result is FirebaseUser
user = await _auth.currentUser();
// result is null
await user.sendEmailVerification();
//null reference, because it internally uses .currentUser()