Edit Profile
The editProfile
function allows users to update their profile details, such as their name, profile picture, widget ID, or additional metadata.
Usage
- Create an
EditProfileRequest
object with the required user ID (uuid
) and any optional parameters you want to update. - Call the
editProfile()
method to submit the request. - 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
Parameter | Type | Description | Optional |
---|---|---|---|
uuid | String | The unique identifier for the user | |
imageUrl | String? | The URL of the user's profile picture | ✔️ |
name | String? | The name of the user | ✔️ |
widgetId | String? | The ID of the widget associated with the user | ✔️ |
metadata | Map<String, dynamic>? | Additional metadata for the user's profile | ✔️ |
Note: The response does not contain a body. It only provides success or failure information.