User Created Comment List
Introduction
The LMFeedUserCreatedCommentListView
widget is a Flutter UI component designed to display comments created by a specific user in the feed. It leverages BLoC architecture and paging controllers to efficiently manage state, pagination, and content loading. This widget provides several customization options through builder functions, giving developers flexibility in rendering post items, handling errors, and displaying loading indicators.
Properties
uuid
(String
) - Required
The UUID of the user whose comments are displayed. This is a required parameter.
postWidgetBuilder
(LMFeedPostWidgetBuilder?)
A builder function that customizes how individual posts are displayed.
emptyFeedViewBuilder
(LMFeedContextWidgetBuilder?)
A builder function to render a widget when no comments are found.
firstPageLoaderBuilder
(LMFeedContextWidgetBuilder?)
A builder function to display a loading indicator when the first page of comments is being fetched.
paginationLoaderBuilder
(LMFeedContextWidgetBuilder?)
A builder function to display a loading indicator when more comments are being fetched during pagination.
feedErrorViewBuilder
(LMFeedContextWidgetBuilder?)
A builder function to render a widget in case of an error.
noNewPageWidgetBuilder
(LMFeedContextWidgetBuilder?)
A builder function to render a widget when no more pages are available for loading.
Usage Example
LMFeedUserCreatedCommentListView(
uuid: "USER_ID", // replace it with actual user id
postBuilder: (context, postWidget, post) {
// wrapped the actual post widget with padding and card
return Card(
margin: const EdgeInsets.all(8.0),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: postWidget,
),
);
},
emptyFeedViewBuilder: (context) => Center(
child: Text("No comments found."),
),
firstPageLoaderBuilder: (context) => Center(
child: CircularProgressIndicator(),
),
feedErrorViewBuilder: (context) => Center(
child: Text("An error occurred. Please try again."),
),
);