Skip to main content

Edit User Profile

To modify the user profile information in the LikeMinds Feed, use the editProfile() function.

Steps to Edit User Profile

  1. Build an EditProfileRequest object using the EditProfileRequestBuilder class.

  2. Call the editProfile() function using the instance of the LMFeedClient class.

  3. 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

VariableTypeDescriptionOptional
nameString?New name of the user
imageUrlString?New URL of the user's profile image
userUniqueIdString?Unique ID of the user
questionCommunityJoinList<QuestionCommunityJoin>?List of question and community associations
metadataMap<String, dynamic>?Custom data to be sent for user

EditProfileResponse

List of parameters for the EditProfileResponse class

VariableTypeDescriptionOptional
errorMessageString?Error message in case of failure
successboolAPI success status

QuestionCommunityJoin

List of parameters for the QuestionCommunityJoin class

VariableTypeDescriptionOptional
questionIdint?Question id associated with the user
answerString?Answer string associated to the question