/ SDKs / Flutter
SDKs
Chat SDKs Flutter v4
Chat SDKs Flutter
Chat SDKs
Flutter
Version 4

Update user profile

Copy link

You can update a user's nickname and profile image with a profile URL using updateCurrentUserInfo(). A user's profile image can be a JPG (.jpg), JPEG (.jpeg), or PNG (.png) file of up to 5 MB.

try {
  await SendbirdChat.updateCurrentUserInfo(
    nickname: 'NICKNAME',
    profileFileInfo: FileInfo.fromFileUrl(fileUrl: 'PROFILE_FILE_URL')
  );
  // The current user's profile is successfully updated.
  // You could redraw the profile in a view in response to this operation.
}

Or you can directly upload a profile image using the FileInfo.fromFile() constructor.

try {
  await SendbirdChat.updateCurrentUserInfo(
    nickname: 'NICKNAME',
    profileFileInfo: FileInfo.fromFile(
      file: FILE,
      fileName: 'FILE_NAME',
      mimeType: 'MIME_TYPE',
    ),
  );
  // The current user's profile is successfully updated.
  // You could redraw the profile in a view in response to this operation.
}