Skip to main content

Save Post

The savePost() function allows users to save posts for layer. You can integrate it in your Flutter app to enhance user experience by allowing them to bookmark and revisit their favorite posts at their convenience. Enable seamless content curation, empowering users to organize and access valuable information with ease.

Steps to Save a Post

  1. Create an instance of SavePostRequest with the required parameter: postId for the post to be saved.
  2. Call the savePost() function using the instance of the LMFeedClient class, passing the request as a parameter.
  3. Use the response as per your requirement.
// Create an instance of SavePostRequest
SavePostRequest request = (SavePostRequestBuilder()
..postId("post_id"))
.build();

// Get the response from calling the function
final SavePostResponse savePostResponse = await lmFeedClient.savePost(savePostRequest);

// Process the response, as per requirement
if (savePostResponse.success) {
// your function to handle successful post saving
handleSavePostSuccess();
} else {
// your function to handle error message
handleSavePostError(savePostResponse.errorMessage);
}

Models

SavePostRequest

List of parameters for the SavePostRequest class

VariableTypeDescriptionOptional
postIdStringID of the post to be saved

SavePostResponse

List of parameters for the SavePostResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in case of failure