This might be similar to this: FirebaseUser's profile is not updated
However, I'm not confident in my Flutter skills to be sure. I'm trying to update DisplayName in Firebase and then have the currentUser.displayName
. The updateProfile seems to run just fine, but the currentUser doesn't update with the new displayName even after a reload() call.
I'm hoping anyone could tell me if I'm doing something wrong, or chalk it up to a bug in Firebase.
My code:
Future _update(FirebaseUser user, String displayName) async {
UserUpdateInfo _updateData= new UserUpdateInfo();
_updateData.displayName = displayName;
await user.updateProfile(_updateData);
await user.reload();
setState(() {
_currentDisplayName = user.displayName;
});
}
it work for me
FirebaseAuth.instance.currentUser().then((val) {
UserUpdateInfo updateUser = UserUpdateInfo();
updateUser.displayName = myFullName;
updateUser.photoUrl = picURL;
val.updateProfile(updateUser);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With