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
Build a
GetFeedOfFeedRoomRequest
object using theGetFeedOfFeedRoomRequestBuilder
class.Call the
getFeedOfFeedRoom()
function using the instance of theLMFeedClient
class.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:
Variable | Type | Description | Optional |
---|---|---|---|
page | int | Page number for pagination | |
pageSize | int | Number of items per page | |
feedroomId | int | ID of the feedroom to fetch details | |
topicIds | List<String> | List of topic IDs to filter feed | ✔ |
GetFeedOfFeedRoomResponse
List of parameters for the GetFeedOfFeedRoomResponse
class:
Variable | Type | Description | Optional |
---|---|---|---|
success | bool | API success status | |
errorMessage | String | Error message in case of failure | ✔ |
posts | List<Post> | List of post models | ✔ |
users | Map<String, User> | Map of user models (key: user ID) | |
topics | Map<String, Topic> | Map of topic models (key: topic ID) | |
widgets | Map<String, WidgetModel> | Map of widget models (key: widget ID) | ✔ |
repostedPosts | Map<String, Post> | Map of reposted post models (key: post ID) | ✔ |
filteredComments | Map<String, Comment> | Map of filtered comments | ✔ |
userTopics | Map<String, List<String>> | Map of user topics (key: user ID) | ✔ |