Skip to main content

Get Feed in Feedroom

The getFeedOfFeedRoom() function is used to retrieve the feed content inside a specific feedroom, including posts, users, topics, and widgets based on specified parameters.

Steps to Get Feed in Feedroom

  1. Build a GetFeedOfFeedRoomRequest object using the GetFeedOfFeedRoomRequestBuilder class.

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

  3. Use the response as per your requirement.

    // Build the request object
    final GetFeedOfFeedRoomRequest feedOfFeedRoomRequest = (GetFeedOfFeedRoomRequestBuilder()
    ..page(1)
    ..pageSize(10)
    ..feedroomId(123))
    .build();

    // Get the response from calling the function
    final GetFeedOfFeedRoomResponse feedOfFeedRoomResponse = await lmFeedClient.getFeedOfFeedRoom(feedOfFeedRoomRequest);

    // Process the response, as per requirement
    if (feedOfFeedRoomResponse.success) {
    // Handle successful retrieval
    handleFeedRoomSuccess(feedOfFeedRoomResponse);
    } else {
    // Handle error message
    handleFeedRoomError(feedOfFeedRoomResponse.errorMessage);
    }
tip

Fetching feed content in a feedroom allows users to view posts and related content based on specific topics or widgets.

Models

GetFeedOfFeedRoomRequest

List of parameters for the GetFeedOfFeedRoomRequest class:

VariableTypeDescriptionOptional
pageintPage number for pagination
pageSizeintNumber of items per page
feedroomIdintID of the feedroom to fetch details
topicIdsList<String>List of topic IDs to filter feed

GetFeedOfFeedRoomResponse

List of parameters for the GetFeedOfFeedRoomResponse class:

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in case of failure
postsList<Post>List of post models
usersMap<String, User>Map of user models (key: user ID)
topicsMap<String, Topic>Map of topic models (key: topic ID)
widgetsMap<String, WidgetModel>Map of widget models (key: widget ID)
repostedPostsMap<String, Post>Map of reposted post models (key: post ID)
filteredCommentsMap<String, Comment>Map of filtered comments
userTopicsMap<String, List<String>>Map of user topics (key: user ID)