updateDisplayName method

Future<void> updateDisplayName(
  1. String? displayName
)

Update user's displayName.

Throws FirebaseAuthException with following possible codes:

  • email-not-found: user doesn't exist TODO

Implementation

Future<void> updateDisplayName(String? displayName) async {
  try {
    _assertSignedOut(_auth);

    await _auth._api.userProfile.updateProfile(
      _idToken,
      uid,
      displayName: displayName,
    );
  } catch (e) {
    rethrow;
  }
}