I am a beginner in app development and am having trouble with this error. The error I get is "error: A value of type 'User?' can't be assigned to a variable of type 'User'."
My Code:
Future signUpWithEmailAndPassword( String email, String password) async {
try {
UserCredential result = await _auth.createUserWithEmailAndPassword(email: email, password: password);
User user = result.user;
return _userFromFirebaseUser(user);
} catch(e){
print(e.toString());
return null;
}
}