From 37401f4374c6f1b04ce8c0c31fe2ca875fd5102b Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sun, 29 Sep 2024 21:01:46 +0800 Subject: [PATCH] opt: reply msg --- .../detail/reply/widgets/reply_item.dart | 82 +++++++++---------- 1 file changed, 38 insertions(+), 44 deletions(-) diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 2e381285d..5007afaaa 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -259,53 +259,47 @@ class ReplyItem extends StatelessWidget { textDirection: Directionality.of(context), )..layout(maxWidth: constraints.maxWidth); bool didExceedMaxLines = textPainter.didExceedMaxLines; - return Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Semantics( - label: text, - child: Text.rich( - style: TextStyle( - height: 1.75, - fontSize: - Theme.of(context).textTheme.bodyMedium!.fontSize), - TextSpan( - children: [ - if (replyItem!.isTop!) ...[ - const WidgetSpan( - alignment: PlaceholderAlignment.top, - child: PBadge( - text: 'TOP', - size: 'small', - stack: 'normal', - type: 'line', - fs: 9, - semanticsLabel: '置顶', - ), - ), - const TextSpan(text: ' '), - ], - buildContent( - context, - replyItem!, - replyReply, - null, - textPainter, - didExceedMaxLines, + return Semantics( + label: text, + child: Text.rich( + style: TextStyle( + height: 1.75, + fontSize: + Theme.of(context).textTheme.bodyMedium!.fontSize), + TextSpan( + children: [ + if (replyItem!.isTop!) ...[ + const WidgetSpan( + alignment: PlaceholderAlignment.top, + child: PBadge( + text: 'TOP', + size: 'small', + stack: 'normal', + type: 'line', + fs: 9, + semanticsLabel: '置顶', ), - ], + ), + const TextSpan(text: ' '), + ], + buildContent( + context, + replyItem!, + replyReply, + null, + textPainter, + didExceedMaxLines, ), - ), + if (didExceedMaxLines) + TextSpan( + text: '\n查看更多', + style: TextStyle( + color: Theme.of(context).colorScheme.primary, + ), + ), + ], ), - if (didExceedMaxLines) - Text( - '查看更多', - style: TextStyle( - color: Theme.of(context).colorScheme.primary, - ), - ), - ], + ), ); }, ),