postBuilder property
PostBuilder?
postBuilder
final
Builder for post.
return PensilPostFeedListView(
sectionId: id,
postBuilder: (BuildContext context, Post post,
void Function(PostAction) onActionTrigger) {
return Card(
child: Column(
children: [
ListTile(
leading: CircleAvatar(
backgroundImage: post.createdBy!.picture == null
? null
: NetworkImage(post.createdBy!.picture!),
),
title: Text(post.createdBy!.name),
subtitle: Text(post.createdAt!.toString()),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: ListBody(
children: [
Text(post.description ?? ""),
Row(
children: [
IconButton(
onPressed: () {
onActionTrigger(PostAction.onLike(post));
},
icon: const Icon(Icons.thumb_up),
),
Text(post.likes.toString()),
const SizedBox(width: 16),
IconButton(
onPressed: () {
onActionTrigger(PostAction.onUserTap(post));
},
icon: const Icon(Icons.comment),
),
Text(post.commentCount.toString()),
],
)
],
),
)
],
),
);
},
);
},
Implementation
final PostBuilder? postBuilder;