Skip to main content

Edit Profile

The editProfile function allows users to update their profile details, such as their name, profile picture, widget ID, or additional metadata.

Usage

  1. Create an EditProfileRequest object with the required user ID (uuid) and any optional parameters you want to update.
  2. Call the editProfile() method to submit the request.
  3. If successful, the response will indicate success without returning additional data.

Example

final EditProfileRequest request = EditProfileRequest(
uuid: 'user123', // Required user ID
name: 'John Doe', // Optional name
imageUrl: 'https://example.com/profile.jpg', // Optional profile picture URL
);

final LMResponse<void> response = await lmChatClient.editProfile(request);

if (response.success) {
print('Profile updated successfully!');
} else {
print('Failed to update profile: ${response.errorMessage}');
}

Models

EditProfileRequest

ParameterTypeDescriptionOptional
uuidStringThe unique identifier for the user
imageUrlString?The URL of the user's profile picture✔️
nameString?The name of the user✔️
widgetIdString?The ID of the widget associated with the user✔️
metadataMap<String, dynamic>?Additional metadata for the user's profile✔️

Note: The response does not contain a body. It only provides success or failure information.