mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-25 03:40:09 +08:00
@@ -304,64 +304,65 @@ class _PgcReviewChildPageState extends State<PgcReviewChildPage>
|
||||
builder: (context) {
|
||||
final Color color = theme.colorScheme.outline;
|
||||
final Color primary = theme.colorScheme.primary;
|
||||
final ButtonStyle style = TextButton.styleFrom(
|
||||
padding: EdgeInsets.zero,
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
);
|
||||
final isLike = item.stat?.liked == 1;
|
||||
late final isDislike = item.stat?.disliked == 1;
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisAlignment: .end,
|
||||
children: [
|
||||
if (!isLongReview)
|
||||
SizedBox(
|
||||
height: 32,
|
||||
child: TextButton(
|
||||
style: style,
|
||||
onPressed: () => _controller.onDislike(
|
||||
item,
|
||||
isDislike,
|
||||
item.reviewId,
|
||||
),
|
||||
child: Icon(
|
||||
isDislike
|
||||
? BiliIcons.ic_disliked
|
||||
: BiliIcons.ic_dislike,
|
||||
size: 16,
|
||||
color: isDislike ? primary : color,
|
||||
),
|
||||
TextButton(
|
||||
style: const ButtonStyle(
|
||||
visualDensity: .compact,
|
||||
tapTargetSize: .shrinkWrap,
|
||||
padding: WidgetStatePropertyAll(.zero),
|
||||
minimumSize: WidgetStatePropertyAll(.square(40)),
|
||||
),
|
||||
onPressed: () => _controller.onDislike(
|
||||
item,
|
||||
isDislike,
|
||||
item.reviewId,
|
||||
),
|
||||
child: Icon(
|
||||
isDislike
|
||||
? BiliIcons.ic_disliked
|
||||
: BiliIcons.ic_dislike,
|
||||
size: 16,
|
||||
color: isDislike ? primary : color,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 32,
|
||||
child: TextButton(
|
||||
style: style,
|
||||
onPressed: isLongReview
|
||||
? null
|
||||
: () => _controller.onLike(
|
||||
item,
|
||||
isLike,
|
||||
item.reviewId,
|
||||
),
|
||||
child: Row(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Icon(
|
||||
isLike ? BiliIcons.ic_liked : BiliIcons.ic_like,
|
||||
size: 16,
|
||||
color: isLike ? primary : color,
|
||||
),
|
||||
Text(
|
||||
NumUtils.numFormat(item.stat?.likes ?? 0),
|
||||
style: TextStyle(
|
||||
color: isLike ? primary : color,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
TextButton(
|
||||
style: const ButtonStyle(
|
||||
visualDensity: .compact,
|
||||
tapTargetSize: .shrinkWrap,
|
||||
minimumSize: WidgetStatePropertyAll(.square(40)),
|
||||
padding: WidgetStatePropertyAll(
|
||||
.symmetric(horizontal: 8),
|
||||
),
|
||||
),
|
||||
onPressed: isLongReview
|
||||
? null
|
||||
: () => _controller.onLike(
|
||||
item,
|
||||
isLike,
|
||||
item.reviewId,
|
||||
),
|
||||
child: Row(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Icon(
|
||||
isLike ? BiliIcons.ic_liked : BiliIcons.ic_like,
|
||||
size: 16,
|
||||
color: isLike ? primary : color,
|
||||
),
|
||||
Text(
|
||||
NumUtils.numFormat(item.stat?.likes ?? 0),
|
||||
style: TextStyle(
|
||||
color: isLike ? primary : color,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -38,7 +38,12 @@ class ActionItem extends StatelessWidget {
|
||||
Widget child = Icon(
|
||||
icon.icon,
|
||||
size: icon.size ?? 20.5,
|
||||
color: selectStatus ? primary : icon.color ?? colorScheme.outline,
|
||||
color: selectStatus
|
||||
? primary
|
||||
: icon.color ??
|
||||
(colorScheme.isDark
|
||||
? colorScheme.outline
|
||||
: colorScheme.outline.withValues(alpha: .85)),
|
||||
);
|
||||
|
||||
if (animation != null) {
|
||||
|
||||
@@ -106,70 +106,69 @@ class ZanButtonGrpc extends StatelessWidget {
|
||||
final isDislike = action == $fixnum.Int64.TWO;
|
||||
final outline = theme.colorScheme.outline;
|
||||
final primary = theme.colorScheme.primary;
|
||||
final ButtonStyle style = TextButton.styleFrom(
|
||||
padding: EdgeInsets.zero,
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
);
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisSize: .min,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 32,
|
||||
child: TextButton(
|
||||
style: style,
|
||||
onPressed: () => EasyThrottle.throttle(
|
||||
'interactAction',
|
||||
const Duration(milliseconds: 200),
|
||||
() => onHateReply(
|
||||
context,
|
||||
isProcessing,
|
||||
() => isProcessing = false,
|
||||
isLike: isLike,
|
||||
isDislike: isDislike,
|
||||
),
|
||||
),
|
||||
child: Icon(
|
||||
isDislike ? BiliIcons.ic_disliked : BiliIcons.ic_dislike,
|
||||
size: 16,
|
||||
color: isDislike ? primary : outline,
|
||||
semanticLabel: isDislike ? '已踩' : '点踩',
|
||||
TextButton(
|
||||
style: const ButtonStyle(
|
||||
visualDensity: .compact,
|
||||
tapTargetSize: .shrinkWrap,
|
||||
padding: WidgetStatePropertyAll(.zero),
|
||||
minimumSize: WidgetStatePropertyAll(.square(40)),
|
||||
),
|
||||
onPressed: () => EasyThrottle.throttle(
|
||||
'interactAction',
|
||||
const Duration(milliseconds: 200),
|
||||
() => onHateReply(
|
||||
context,
|
||||
isProcessing,
|
||||
() => isProcessing = false,
|
||||
isLike: isLike,
|
||||
isDislike: isDislike,
|
||||
),
|
||||
),
|
||||
child: Icon(
|
||||
isDislike ? BiliIcons.ic_disliked : BiliIcons.ic_dislike,
|
||||
size: 16,
|
||||
color: isDislike ? primary : outline,
|
||||
semanticLabel: isDislike ? '已踩' : '点踩',
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 32,
|
||||
child: TextButton(
|
||||
style: style,
|
||||
onPressed: () => EasyThrottle.throttle(
|
||||
'interactAction',
|
||||
const Duration(milliseconds: 200),
|
||||
() => onLikeReply(
|
||||
context,
|
||||
isProcessing,
|
||||
() => isProcessing = false,
|
||||
isLike: isLike,
|
||||
isDislike: isDislike,
|
||||
TextButton(
|
||||
style: const ButtonStyle(
|
||||
visualDensity: .compact,
|
||||
tapTargetSize: .shrinkWrap,
|
||||
minimumSize: WidgetStatePropertyAll(.square(40)),
|
||||
padding: WidgetStatePropertyAll(.symmetric(horizontal: 8)),
|
||||
),
|
||||
onPressed: () => EasyThrottle.throttle(
|
||||
'interactAction',
|
||||
const Duration(milliseconds: 200),
|
||||
() => onLikeReply(
|
||||
context,
|
||||
isProcessing,
|
||||
() => isProcessing = false,
|
||||
isLike: isLike,
|
||||
isDislike: isDislike,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Icon(
|
||||
isLike ? BiliIcons.ic_liked : BiliIcons.ic_like,
|
||||
size: 16,
|
||||
color: isLike ? primary : outline,
|
||||
semanticLabel: isLike ? '已赞' : '点赞',
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Icon(
|
||||
isLike ? BiliIcons.ic_liked : BiliIcons.ic_like,
|
||||
size: 16,
|
||||
Text(
|
||||
NumUtils.numFormat(replyItem.like.toInt()),
|
||||
style: TextStyle(
|
||||
color: isLike ? primary : outline,
|
||||
semanticLabel: isLike ? '已赞' : '点赞',
|
||||
fontSize: theme.textTheme.labelSmall!.fontSize,
|
||||
),
|
||||
Text(
|
||||
NumUtils.numFormat(replyItem.like.toInt()),
|
||||
style: TextStyle(
|
||||
color: isLike ? primary : outline,
|
||||
fontSize: theme.textTheme.labelSmall!.fontSize,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user