updateUser method

Future<UserRecord> updateUser(
  1. String uid, {
  2. bool? disabled,
  3. String? displayName,
  4. String? email,
  5. bool? emailVerified,
  6. String? password,
  7. String? phoneNumber,
  8. Uri? photoUrl,
  9. List<UpdateMultiFactorInfoRequest>? multiFactorEnrolledFactors,
})

Updates an existing user.

Set displayName, photoUrl and/or phoneNumber to the empty string to remove them from the user record. When phone number is removed, also the corresponding provider will be removed.

Implementation

Future<UserRecord> updateUser(
  String uid, {
  bool? disabled,
  String? displayName,
  String? email,
  bool? emailVerified,
  String? password,
  String? phoneNumber,
  Uri? photoUrl,
  List<UpdateMultiFactorInfoRequest>? multiFactorEnrolledFactors,
}) async {
  uid = await _authRequestHandler.updateExistingAccount(
    uid,
    disableUser: disabled,
    displayName: displayName,
    email: email,
    emailVerified: emailVerified,
    password: password,
    phoneNumber: phoneNumber,
    photoUrl: photoUrl?.toString(),
    multiFactorEnrolledFactors: multiFactorEnrolledFactors,
  );
  // Return the corresponding user record.
  return await getUser(uid);
}