I want to add a user's DisplayName upon creating a new user. When I tried to use updateProfile method, it gives below warning
/// Updates a user's profile data.
@Deprecated( 'Will be removed in version 2.0.0. ' 'Use updatePhotoURL and updateDisplayName instead.',
How can get around this ??
String email, String password) async {
final UserCredential userCredential =
await _firebaseAuth.createUserWithEmailAndPassword(
email: email.trim(), password: password.trim());
await userCredential.user.updateDisplayName('Mohamed Rahuman');
User user = userCredential.user;
print(user);
return _userFromFirebaseUser(user);
}
flutter: User(displayName: null, email: [email protected], emailVerified: false, isAnonymous: false, metadata: UserMetadata(creationTime: 2021-06-06 10:35:13.689, lastSignInTime: 2021-06-06 10:35:13.689), phoneNumber: null, photoURL: null, providerData, [UserInfo(displayName: null, email: [email protected], phoneNumber: null, photoURL: null, providerId: password, uid: [email protected])], refreshToken: , tenantId: null, uid: gghhhhhhhh55555666)
THIS IS FIXED: with firebase_auth 1.3.0 (see the Changelog)
reload()
(pub.dev/documentation/firebase_auth/latest/firebase_auth/User/…) before print statement like this:await userCredential.user.reload()
– Simon Sot