From 7331038cdc1446065f55eeb15d1601c7bc3450d3 Mon Sep 17 00:00:00 2001 From: orz12 Date: Thu, 7 Mar 2024 09:32:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A0=E9=9A=9C=E7=A2=8D=E4=BD=93?= =?UTF-8?q?=E9=AA=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/dynamics/detail/view.dart | 3 +- lib/pages/dynamics/widgets/video_panel.dart | 10 ++- .../detail/reply/widgets/reply_item.dart | 84 ++++++++++--------- 3 files changed, 53 insertions(+), 44 deletions(-) diff --git a/lib/pages/dynamics/detail/view.dart b/lib/pages/dynamics/detail/view.dart index 57e3e9bc..6d6d996d 100644 --- a/lib/pages/dynamics/detail/view.dart +++ b/lib/pages/dynamics/detail/view.dart @@ -249,13 +249,12 @@ class _DynamicDetailPageState extends State scale: animation, child: child); }, child: Text( - '${_dynamicDetailController.acount.value}', + '${_dynamicDetailController.acount.value}条回复', key: ValueKey( _dynamicDetailController.acount.value), ), ), ), - const Text('条回复'), const Spacer(), SizedBox( height: 35, diff --git a/lib/pages/dynamics/widgets/video_panel.dart b/lib/pages/dynamics/widgets/video_panel.dart index c11e1bde..f163593c 100644 --- a/lib/pages/dynamics/widgets/video_panel.dart +++ b/lib/pages/dynamics/widgets/video_panel.dart @@ -117,7 +117,8 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) { Colors.black54, ], ), - borderRadius: BorderRadius.circular(StyleString.imgRadius.x)), + borderRadius: + BorderRadius.circular(StyleString.imgRadius.x)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.end, @@ -131,7 +132,12 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) { color: Colors.white), child: Row( children: [ - Text(content.durationText ?? ''), + if (content.durationText != null) + Text( + content.durationText, + semanticsLabel: + '时长${Utils.durationReadFormat(content.durationText)}', + ), if (content.durationText != null) const SizedBox(width: 10), Text(content.stat.play + '次围观'), diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 9945b3cd..c4ef2a2a 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -214,6 +214,7 @@ class ReplyItem extends StatelessWidget { margin: const EdgeInsets.only(top: 10, left: 45, right: 6, bottom: 4), child: Semantics( label: replyItem?.content?.message ?? "", + excludeSemantics: true, child: Text.rich( style: const TextStyle(height: 1.75), maxLines: @@ -387,48 +388,51 @@ class ReplyItemRow extends StatelessWidget { 8, i == 0 && (extraRow == 1 || replies!.length > 1) ? 5 : 6, ), - child: Text.rich( - overflow: TextOverflow.ellipsis, - maxLines: 2, - TextSpan( - children: [ + child: Semantics( + label: replies![i].member.uname + ' ' + replies![i].content.message, + excludeSemantics: true, + child: Text.rich( + overflow: TextOverflow.ellipsis, + maxLines: 2, TextSpan( - text: replies![i].member.uname + ' ', - style: TextStyle( - fontSize: Theme.of(context) - .textTheme - .titleSmall! - .fontSize, - color: Theme.of(context).colorScheme.primary, - ), - recognizer: TapGestureRecognizer() - ..onTap = () { - feedBack(); - final String heroTag = - Utils.makeHeroTag(replies![i].member.mid); - Get.toNamed( - '/member?mid=${replies![i].member.mid}', - arguments: { - 'face': replies![i].member.avatar, - 'heroTag': heroTag - }); - }, - ), - if (replies![i].isUp) - const WidgetSpan( - alignment: PlaceholderAlignment.top, - child: PBadge( - text: 'UP', - size: 'small', - stack: 'normal', - fs: 9, + children: [ + TextSpan( + text: replies![i].member.uname + ' ', + style: TextStyle( + fontSize: Theme.of(context) + .textTheme + .titleSmall! + .fontSize, + color: Theme.of(context).colorScheme.primary, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + feedBack(); + final String heroTag = Utils.makeHeroTag( + replies![i].member.mid); + Get.toNamed( + '/member?mid=${replies![i].member.mid}', + arguments: { + 'face': replies![i].member.avatar, + 'heroTag': heroTag + }); + }, ), - ), - buildContent( - context, replies![i], replyReply, replyItem), - ], - ), - ), + if (replies![i].isUp) + const WidgetSpan( + alignment: PlaceholderAlignment.top, + child: PBadge( + text: 'UP', + size: 'small', + stack: 'normal', + fs: 9, + ), + ), + buildContent( + context, replies![i], replyReply, replyItem), + ], + ), + )), ), ) ],