Reputation: 33
I am running my dart code embedded with firebase but it shows the above error. What could be the problem?
Upvotes: 0
Views: 47
Reputation: 63549
.createUserWithEmailAndPassword
return nullable User.
You can make it nullable like like
final UserCredential credential =
await _auth.signInWithEmailAndPassword(email: "", password: "");
final User? user = credential.user;
if (user != null) {
} else {
//failed
}
More about /understanding-null-safety
Upvotes: 1