Edit User Profile
To modify the user profile information in the LikeMinds Feed, use the editProfile()
function.
Steps to Edit User Profile
Build an
EditProfileRequest
object using theEditProfileRequestBuilder
class.Call the
editProfile()
function using the instance of theLMFeedClient
class.Use the response as per your requirement.
// Provide user details for editing the profile
String userUniqueId = "user_unique_id_here";
String? name = "new_user_name";
String? imageUrl = "new_user_profile_image_url";
// Build the request object
EditProfileRequest request = (EditProfileRequestBuilder()
..userUniqueId(userUniqueId)
..name(name)
..imageUrl(imageUrl))
.build();
// Get the response from calling the function
final EditProfileResponse response = await lmFeedClient.editProfile(request);
// Process the response, as per requirement
if(response.success){
// your function to handle successful profile edit
handleSuccessfulEdit(response);
} else {
// your function to handle error message
handleEditError(response.errorMessage);
}
Models
EditProfileRequest
List of parameters for the EditProfileRequest
class
Variable | Type | Description | Optional |
---|---|---|---|
name | String? | New name of the user | ✔ |
imageUrl | String? | New URL of the user's profile image | ✔ |
userUniqueId | String? | Unique ID of the user | |
questionCommunityJoin | List<QuestionCommunityJoin >? | List of question and community associations | ✔ |
metadata | Map<String, dynamic>? | Custom data to be sent for user | ✔ |
EditProfileResponse
List of parameters for the EditProfileResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
errorMessage | String? | Error message in case of failure | ✔ |
success | bool | API success status |
QuestionCommunityJoin
List of parameters for the QuestionCommunityJoin
class
Variable | Type | Description | Optional |
---|---|---|---|
questionId | int? | Question id associated with the user | ✔ |
answer | String? | Answer string associated to the question | ✔ |