display comment liked count

This commit is contained in:
niuhuan 2021-11-02 13:07:28 +08:00
parent ac601c3d79
commit cf14565825
1 changed files with 37 additions and 15 deletions

View File

@ -74,21 +74,43 @@ class ComicCommentItem extends StatelessWidget {
Text( Text(
"Lv. ${comment.user.level} (${comment.user.title})", "Lv. ${comment.user.level} (${comment.user.title})",
style: levelStyle), style: levelStyle),
comment.commentsCount > 0 Text.rich(TextSpan(
? Text.rich(TextSpan(children: [ style: levelStyle,
WidgetSpan( children: [
alignment: PlaceholderAlignment.middle, comment.commentsCount > 0
child: Icon(Icons.message, ? TextSpan(children: [
size: 13, WidgetSpan(
color: theme.colorScheme.secondary alignment: PlaceholderAlignment.middle,
.withOpacity(.7)), child: Icon(Icons.message,
), size: 13,
WidgetSpan(child: Container(width: 5)), color: theme.colorScheme.secondary
TextSpan( .withOpacity(.7)),
text: '${comment.commentsCount}', ),
style: levelStyle), WidgetSpan(child: Container(width: 5)),
])) TextSpan(
: Container(), text: '${comment.commentsCount}',
),
])
: TextSpan(),
WidgetSpan(child: Container(width: 12)),
TextSpan(children: [
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Icon(
comment.isLiked
? Icons.favorite
: Icons.favorite_border,
size: 13,
color: theme.colorScheme.secondary
.withOpacity(.7)),
),
WidgetSpan(child: Container(width: 5)),
TextSpan(
text: '${comment.likesCount}',
),
]),
],
)),
], ],
), ),
); );