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. String? photoUrl,
})

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,
  String? photoUrl,
}) async {
  uid = await _authRequestHandler.updateExistingAccount(
      uid,
      CreateEditAccountRequest(
          disabled: disabled,
          displayName: displayName,
          email: email,
          emailVerified: emailVerified,
          password: password,
          phoneNumber: phoneNumber,
          photoUrl: photoUrl,
          uid: uid));
  // Return the corresponding user record.
  return await getUser(uid);
}