From 3263ff89496972725e32a02aabac7df121bc1481 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sat, 21 Sep 2024 11:25:30 +0800 Subject: [PATCH] opt: video reply --- lib/common/widgets/badge.dart | 4 ++-- .../video/detail/reply/widgets/reply_item.dart | 8 ++++---- lib/utils/app_scheme.dart | 13 ++++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/common/widgets/badge.dart b/lib/common/widgets/badge.dart index 34d042aa..6b2a1d6d 100644 --- a/lib/common/widgets/badge.dart +++ b/lib/common/widgets/badge.dart @@ -50,12 +50,12 @@ class PBadge extends StatelessWidget { } EdgeInsets paddingStyle = - const EdgeInsets.symmetric(vertical: 1, horizontal: 3); + const EdgeInsets.symmetric(vertical: 2, horizontal: 3); double fontSize = 11; BorderRadius br = BorderRadius.circular(4); if (size == 'small') { - paddingStyle = const EdgeInsets.symmetric(vertical: 1, horizontal: 3); + paddingStyle = const EdgeInsets.symmetric(vertical: 2, horizontal: 3); fontSize = 11; br = BorderRadius.circular(3); } diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 79bfa655..ce9830f1 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -262,7 +262,7 @@ class ReplyItem extends StatelessWidget { children: [ if (replyItem!.isTop!) ...[ const WidgetSpan( - alignment: PlaceholderAlignment.middle, + alignment: PlaceholderAlignment.top, child: PBadge( text: 'TOP', size: 'small', @@ -467,7 +467,7 @@ class ReplyItemRow extends StatelessWidget { if (replies![i].isUp!) ...[ const TextSpan(text: ' '), const WidgetSpan( - alignment: PlaceholderAlignment.middle, + alignment: PlaceholderAlignment.top, child: PBadge( text: 'UP', size: 'small', @@ -1160,7 +1160,7 @@ class MorePanel extends StatelessWidget { ), ), // 已登录用户才显示删除 - if (GStorage.userInfo.get('userInfoCache') != null) + if (GStorage.userInfo.get('userInfoCache') != null) ...[ ListTile( onTap: () async => await menuActionHandler('delete'), minLeadingWidth: 0, @@ -1171,7 +1171,6 @@ class MorePanel extends StatelessWidget { .titleSmall! .copyWith(color: errorColor)), ), - if (GStorage.userInfo.get('userInfoCache') != null) ListTile( onTap: () async => await menuActionHandler('report'), minLeadingWidth: 0, @@ -1182,6 +1181,7 @@ class MorePanel extends StatelessWidget { .titleSmall! .copyWith(color: errorColor)), ), + ], ListTile( onTap: () async => await menuActionHandler('copyAll'), minLeadingWidth: 0, diff --git a/lib/utils/app_scheme.dart b/lib/utils/app_scheme.dart index e3ed6581..c5608d4d 100644 --- a/lib/utils/app_scheme.dart +++ b/lib/utils/app_scheme.dart @@ -242,11 +242,14 @@ class PiliScheme { final int cid = await SearchHttp.ab2c(bvid: bvidVal, aid: aidVal); SmartDialog.dismiss(); final String heroTag = Utils.makeHeroTag(aid); - Get.toNamed('/video?bvid=$bvid&cid=$cid', - arguments: { - 'pic': null, - 'heroTag': heroTag, - }); + Get.toNamed( + '/video?bvid=$bvid&cid=$cid', + arguments: { + 'pic': null, + 'heroTag': heroTag, + }, + preventDuplicates: false, + ); } catch (e) { SmartDialog.dismiss(); SmartDialog.showToast('video获取失败: $e');