Flutter: Update a user

Updates user data for a logged in user.

Examples

Update the email for an authenticated user

final UserResponse res = await supabase.auth.updateUser(
  UserAttributes(
    email: 'example@email.com',
  ),
);
final User? updatedUser = res.user;

Update the password for an authenticated user

final UserResponse res = await supabase.auth.updateUser(
  UserAttributes(
    password: 'new password',
  ),
);
final User? updatedUser = res.user;

Update the user's metadata

final UserResponse res = await supabase.auth.updateUser(
  UserAttributes(
    data: \{ 'hello': 'world' \},
  ),
);
final User? updatedUser = res.user;

Update the user's password with a nonce

supabase.auth.updateUser(UserAttributes(
  email: 'example@email.com',
  nonce: '123456',
));