From 1a6653ba93423ab78c518618191bc47367570118 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Fri, 12 Dec 2025 14:15:09 +0800 Subject: [PATCH] opt reply Signed-off-by: bggRGjQaUbCoE --- .../video/reply/widgets/reply_item_grpc.dart | 70 +++++-------------- 1 file changed, 18 insertions(+), 52 deletions(-) diff --git a/lib/pages/video/reply/widgets/reply_item_grpc.dart b/lib/pages/video/reply/widgets/reply_item_grpc.dart index 2c7eeeab2..cdcb17b13 100644 --- a/lib/pages/video/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/reply/widgets/reply_item_grpc.dart @@ -339,7 +339,12 @@ class ReplyItemGrpc extends StatelessWidget { ThemeData theme, ReplyControl replyControl, ) { - final ButtonStyle style = TextButton.styleFrom( + final textStyle = TextStyle( + fontSize: theme.textTheme.labelMedium!.fontSize, + color: theme.colorScheme.outline, + fontWeight: FontWeight.normal, + ); + final buttonStyle = TextButton.styleFrom( padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap, visualDensity: VisualDensity.compact, @@ -350,7 +355,7 @@ class ReplyItemGrpc extends StatelessWidget { SizedBox( height: 32, child: TextButton( - style: style, + style: buttonStyle, onPressed: () { feedBack(); onReply?.call(replyItem); @@ -363,60 +368,28 @@ class ReplyItemGrpc extends StatelessWidget { color: theme.colorScheme.outline.withValues(alpha: 0.8), ), const SizedBox(width: 3), - Text( - '回复', - style: TextStyle( - fontSize: theme.textTheme.labelMedium!.fontSize, - color: theme.colorScheme.outline, - ), - ), + Text('回复', style: textStyle), ], ), ), ), const SizedBox(width: 2), - if (replyItem.replyControl.upLike) ...[ - SizedBox( - height: 32, - child: TextButton( - onPressed: null, - style: style, - child: Text( - 'UP主觉得很赞', - style: TextStyle( - color: theme.colorScheme.secondary, - fontSize: theme.textTheme.labelMedium!.fontSize, - fontWeight: FontWeight.normal, - ), - ), - ), + if (replyItem.replyControl.cardLabels.isNotEmpty) ...[ + Text( + replyItem.replyControl.cardLabels + .map((e) => e.textContent) + .join(' '), + style: textStyle.copyWith(color: theme.colorScheme.secondary), ), const SizedBox(width: 2), ], - if (replyItem.replyControl.cardLabels - .map((item) => item.textContent) - .contains('热评')) - Text( - '热评', - style: TextStyle( - color: theme.colorScheme.secondary, - fontSize: theme.textTheme.labelMedium!.fontSize, - ), - ), if (replyLevel == 2 && needDivider && replyItem.id != replyItem.dialog) SizedBox( height: 32, child: TextButton( onPressed: showDialogue, - style: style, - child: Text( - '查看对话', - style: TextStyle( - color: theme.colorScheme.outline, - fontSize: theme.textTheme.labelMedium!.fontSize, - fontWeight: FontWeight.normal, - ), - ), + style: buttonStyle, + child: Text('查看对话', style: textStyle), ), ) else if (replyLevel == 3 && @@ -426,15 +399,8 @@ class ReplyItemGrpc extends StatelessWidget { height: 32, child: TextButton( onPressed: jumpToDialogue, - style: style, - child: Text( - '跳转回复', - style: TextStyle( - color: theme.colorScheme.outline, - fontSize: theme.textTheme.labelMedium!.fontSize, - fontWeight: FontWeight.normal, - ), - ), + style: buttonStyle, + child: Text('跳转回复', style: textStyle), ), ), const Spacer(),