From 7ec2fbb67d079f025a2d42ba2ece39e8ab01e76f Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Tue, 27 Aug 2024 09:40:53 +0800 Subject: [PATCH] opt: reply2reply showing --- lib/common/widgets/badge.dart | 20 ++++++++++++------ .../detail/reply/widgets/reply_item.dart | 21 +++++++++++++------ 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/lib/common/widgets/badge.dart b/lib/common/widgets/badge.dart index f19a8089..9db23e09 100644 --- a/lib/common/widgets/badge.dart +++ b/lib/common/widgets/badge.dart @@ -55,7 +55,7 @@ class PBadge extends StatelessWidget { BorderRadius br = BorderRadius.circular(4); if (size == 'small') { - paddingStyle = const EdgeInsets.symmetric(vertical: 0, horizontal: 3); + paddingStyle = const EdgeInsets.symmetric(vertical: 1, horizontal: 3); fontSize = 11; br = BorderRadius.circular(3); } @@ -69,7 +69,18 @@ class PBadge extends StatelessWidget { ), child: Text( text ?? "", - style: TextStyle(fontSize: fs ?? fontSize, color: color), + style: TextStyle( + height: 1, + fontSize: fs ?? fontSize, + color: color, + fontWeight: FontWeight.bold, + ), + strutStyle: StrutStyle( + leading: 0, + height: 1, + fontSize: fs ?? fontSize, + fontWeight: FontWeight.bold, + ), semanticsLabel: semanticsLabel, ), ); @@ -82,10 +93,7 @@ class PBadge extends StatelessWidget { child: content, ); } else { - return Padding( - padding: const EdgeInsets.only(right: 5), - child: content, - ); + return content; } } } diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index ef5afb3a..3f0eeaa7 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -252,9 +252,9 @@ class ReplyItem extends StatelessWidget { overflow: TextOverflow.ellipsis, TextSpan( children: [ - if (replyItem!.isTop!) + if (replyItem!.isTop!) ...[ const WidgetSpan( - alignment: PlaceholderAlignment.top, + alignment: PlaceholderAlignment.middle, child: PBadge( text: 'TOP', size: 'small', @@ -264,6 +264,8 @@ class ReplyItem extends StatelessWidget { semanticsLabel: '置顶', ), ), + const TextSpan(text: ' '), + ], buildContent(context, replyItem!, replyReply, null), ], ), @@ -463,21 +465,28 @@ class ReplyItemRow extends StatelessWidget { if (replies![i].isUp!) ...[ const TextSpan(text: ' '), const WidgetSpan( - alignment: PlaceholderAlignment.top, + alignment: PlaceholderAlignment.middle, child: PBadge( text: 'UP', size: 'small', stack: 'normal', fs: 9, ), - ) + ), + const TextSpan(text: ' '), ], TextSpan( text: replies![i].root == replies![i].parent ? ': ' - : ' '), + : replies![i].isUp! + ? '' + : ' '), buildContent( - context, replies![i], replyReply, replyItem), + context, + replies![i], + replyReply, + replyItem, + ), ], ), )),