Get User Activity
The getUserActivity()
function is used to fetch the user activity. It takes a GetUserActivityRequest
as input, which includes the user's UUID, page number, and page size. The function returns a GetUserActivityResponse
as a Future.
Steps to Get User Activity
- Create an instance of
GetUserActivityRequest
using theGetUserActivityRequestBuilder
class. - Call the
getUserActivity()
function using the instance of theLMFeedClient
class, passing the request as a parameter. - Use the response as per your requirement.
final GetUserActivityRequest userActivityRequest = (GetUserActivityRequestBuilder()
..uuid('user_uuid')
..page(1)
..page(10))
.build();
// Get the response from calling the function
final GetUserActivityResponse userActivityResponse = await lmFeedClient.getUserActivity(userActivityRequest);
// Process the response, as per requirement
if(userActivityResponse.success){
// your function to handle successful retrieval of user activity
handleUserActivitySuccess();
}else{
// your function to handle error message
handleUserActivityError(userActivityResponse.errorMessage);
}
Models
GetUserActivityRequest
List of parameters for the GetUserActivityRequest
class
Variable | Type | Description | Optional |
---|---|---|---|
uuid | String | User's UUID | |
page | int | Page number for pagination | |
pageSize | int | Number of items per page |
GetUserActivityResponse
List of parameters for the GetUserActivityResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
success | bool | API success status | |
errorMessage | String | Error message in case of failure | ✔ |
activities | List<UserActivityItem > | List of user activity items | |
users | Map<String, User > | Map of user UUIDs to User entities | |
topics | Map<String, Topic > | Map of topic IDs to Topic entities | |
widgets | Map<String, WidgetModel > | Map of widget IDs to WidgetModel entities |