Skip to main content

User Activity Widget

Introduction

The LMFeedActivityWidget widget is designed to display a list of user activities. It fetches activity data from the APIs and renders different activities, such as post like, comment. The widget allows customization through builder functions for posts, comments, and the app bar, providing flexibility to modify the appearance and functionality as needed.

note

This widget only show 3 most recent activities with a button to navigate LMFeedActivityScreen. if you wish to display all the activities at once consider using LMFeedActivityScreen directly.

Properties

  • uuid (String) - Required

The UUID of the user whose activities are to be displayed. This property is required to load the relevant user’s activity feed.

A builder function to customize how individual posts are displayed in the activity feed.

A builder function to render custom UI for comments associated with the activities.

Usage

Below is an example demonstrating how to use the LMFeedActivityWidget to display a list of user activities with customized post and comment builders.

Example Code

LMFeedActivityWidget(
uuid: "USER_ID", // replace it with actual user id
postWidgetBuilder: (context, postWidget, post) {
return Card(
margin: const EdgeInsets.symmetric(vertical: 8.0),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Text(post.text),
),
);
},
commentWidgetBuilder: (context, commentWidget, comment) {
return ListTile(
title: Text(comment.text),
);
},
);