updateUser method

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

Changes the given properties of the user uid and returns the user as stored. A null argument leaves the property as it is. Throws user-not-found and the errors of createUser.

Implementation

Future<AdminUser> updateUser(
  String uid, {
  String? email,
  String? password,
  bool? emailVerified,
  String? displayName,
  String? photoUrl,
  String? phoneNumber,
  bool? disabled,
}) async {
  _checkOpen();
  _checkUid(uid);
  _checkProperties(
    email: email,
    password: password,
    displayName: displayName,
    photoUrl: photoUrl,
    phoneNumber: phoneNumber,
  );
  await _identityToolkit('accounts:update', <String, Object?>{
    'localId': uid,
    'email': ?email,
    'password': ?password,
    'emailVerified': ?emailVerified,
    'displayName': ?displayName,
    'photoUrl': ?photoUrl,
    'phoneNumber': ?phoneNumber,
    'disableUser': ?disabled,
  });
  return getUser(uid);
}