diff --git a/lib/common/widgets/badge.dart b/lib/common/widgets/badge.dart index 3f316b88..3a7c8f83 100644 --- a/lib/common/widgets/badge.dart +++ b/lib/common/widgets/badge.dart @@ -59,8 +59,13 @@ class PBadge extends StatelessWidget { bgColor = Colors.black45; color = Colors.white; case PBadgeType.error: - bgColor = theme.error; - color = theme.onError; + if (Get.isDarkMode) { + bgColor = theme.errorContainer; + color = theme.onErrorContainer; + } else { + bgColor = theme.error; + color = theme.onError; + } case PBadgeType.line_primary: color = theme.primary; bgColor = Colors.transparent; diff --git a/lib/models/dynamics/result.dart b/lib/models/dynamics/result.dart index 7883befc..abb27506 100644 --- a/lib/models/dynamics/result.dart +++ b/lib/models/dynamics/result.dart @@ -1165,7 +1165,7 @@ class Badge { String? text; Badge.fromJson(Map json) { - text = json['text']; + text = json['text'] == '投稿视频' ? null : json['text']; } } diff --git a/lib/pages/dynamics/widgets/live_panel_sub.dart b/lib/pages/dynamics/widgets/live_panel_sub.dart index c9a5e546..9d9cf7a6 100644 --- a/lib/pages/dynamics/widgets/live_panel_sub.dart +++ b/lib/pages/dynamics/widgets/live_panel_sub.dart @@ -42,14 +42,26 @@ Widget livePanelSub( PBadge( text: content.watchedShow?.textLarge, top: 6, - right: 56, + right: 70, + fontSize: 10.5, type: PBadgeType.gray, ), - PBadge( - text: content.liveStatus == 1 ? '直播中' : '直播结束', - top: 6, - right: 6, - ), + if (content.liveStatus == 1) + Positioned( + right: 6, + top: 6, + child: Image.asset( + height: 16, + 'assets/images/live/live.gif', + filterQuality: FilterQuality.low, + ), + ) + else + const PBadge( + text: '直播结束', + top: 6, + right: 6, + ), if (content.areaName != null) Positioned( left: 0, diff --git a/lib/pages/dynamics/widgets/live_rcmd_panel.dart b/lib/pages/dynamics/widgets/live_rcmd_panel.dart index 987bb280..29403669 100644 --- a/lib/pages/dynamics/widgets/live_rcmd_panel.dart +++ b/lib/pages/dynamics/widgets/live_rcmd_panel.dart @@ -41,14 +41,27 @@ Widget liveRcmdPanel( PBadge( text: liveRcmd.watchedShow?.textLarge, top: 6, - right: 56, + right: 65, + fontSize: 10.5, type: PBadgeType.gray, ), - PBadge( - text: liveRcmd.liveStatus == 1 ? '直播中' : '直播结束', - top: 6, - right: 6, - ), + if (liveRcmd.liveStatus == 1) + Positioned( + right: 6, + top: 6, + child: Image.asset( + height: 16, + 'assets/images/live/live.gif', + filterQuality: FilterQuality.low, + ), + ) + else + const PBadge( + text: '直播结束', + top: 6, + right: 6, + type: PBadgeType.gray, + ), if (liveRcmd.areaName != null) Positioned( left: 0, diff --git a/lib/pages/dynamics/widgets/video_panel.dart b/lib/pages/dynamics/widgets/video_panel.dart index bde1d3ad..1fcd8556 100644 --- a/lib/pages/dynamics/widgets/video_panel.dart +++ b/lib/pages/dynamics/widgets/video_panel.dart @@ -76,9 +76,10 @@ Widget videoSeasonWidget( right: 10.0, bottom: null, left: null, - type: itemContent.badge!.text == '充电专属' - ? PBadgeType.error - : PBadgeType.primary, + type: switch (itemContent.badge!.text) { + '充电专属' => PBadgeType.error, + _ => PBadgeType.primary, + }, ), Positioned( left: 0, diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index 932ab51c..50cf5afa 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -203,7 +203,6 @@ class _MainAppState extends State ), child: Scaffold( extendBody: true, - resizeToAvoidBottomInset: false, appBar: AppBar(toolbarHeight: 0), body: SafeArea( bottom: false,