buildComment method

ListTile buildComment(
  1. BuildContext context,
  2. WidgetRef ref,
  3. List<InlineSpan> spans
)

Builds the comment tile with the given spans.

Implementation

ListTile buildComment(
  BuildContext context,
  WidgetRef ref,
  List<InlineSpan> spans,
) {
  return ListTile(
    visualDensity: VisualDensity.compact,
    titleAlignment: ListTileTitleAlignment.top,
    dense: true,
    leading: ProfilePicture(
      id: comment.userID,
      heroTag: comment.commentID,
      iconSize: 36,
    ),
    title: Row(
      children: [
        NameTag(id: comment.userID),
        Text(
          " • ${timeAgo(comment.commentDate!)}${comment.isEdited ? " • ${t.comment.edited}" : ""}",
          style: Theme.of(context).textTheme.labelMedium!.copyWith(
                color: Theme.of(context).colorScheme.onSurfaceVariant,
              ),
        ),
      ],
    ),
    subtitle: SelectableText.rich(
      TextSpan(children: spans),
      textAlign: TextAlign.justify,
    ),
    trailing: (ref.watch(currentUserProvider)!.uid! == comment.userID)
        ? commentMenu(context, ref)
        : null,
  );
}