diff --git a/lib/models_new/later/list.dart b/lib/models_new/later/list.dart index a977d5ac..71baf596 100644 --- a/lib/models_new/later/list.dart +++ b/lib/models_new/later/list.dart @@ -52,6 +52,7 @@ class LaterItemModel with MultiSelectData { int? missionId; String? firstFrame; int? seasonId; + bool? isCharging; LaterItemModel({ this.aid, @@ -98,6 +99,7 @@ class LaterItemModel with MultiSelectData { this.missionId, this.firstFrame, this.seasonId, + this.isCharging, }); factory LaterItemModel.fromJson(Map json) => LaterItemModel( @@ -155,10 +157,11 @@ class LaterItemModel with MultiSelectData { enableVt: json['enable_vt'] as int?, viewText1: json['view_text_1'] as String?, isPgc: json['is_pgc'] as bool?, - pgcLabel: json['pgc_label'] as String?, + pgcLabel: json['pgc_label'] == '' ? null : json['pgc_label'], isPugv: json['is_pugv'] as bool?, missionId: json['mission_id'] as int?, firstFrame: json['first_frame'] as String?, seasonId: json['season_id'] as int?, + isCharging: json['charging_pay']?['level'] != null, ); } diff --git a/lib/pages/about/view.dart b/lib/pages/about/view.dart index 800b9568..f14f4972 100644 --- a/lib/pages/about/view.dart +++ b/lib/pages/about/view.dart @@ -60,6 +60,7 @@ class _AboutPageState extends State { @override Widget build(BuildContext context) { final theme = Theme.of(context); + const style = TextStyle(fontSize: 15); final outline = theme.colorScheme.outline; final subTitleStyle = TextStyle(fontSize: 13, color: outline); return Scaffold( @@ -222,7 +223,8 @@ Commit Hash: ${BuildConfig.commitHash}''', clipBehavior: Clip.hardEdge, children: [ ListTile( - title: const Text('导出'), + dense: true, + title: const Text('导出', style: style), onTap: () { Get.back(); String res = jsonEncode(Accounts.account.toMap()); @@ -230,7 +232,8 @@ Commit Hash: ${BuildConfig.commitHash}''', }, ), ListTile( - title: const Text('导入'), + dense: true, + title: const Text('导入', style: style), onTap: () async { Get.back(); ClipboardData? data = @@ -302,7 +305,8 @@ Commit Hash: ${BuildConfig.commitHash}''', title: const Text('导入/导出设置'), children: [ ListTile( - title: const Text('导出设置至剪贴板'), + dense: true, + title: const Text('导出设置至剪贴板', style: style), onTap: () { Get.back(); String data = GStorage.exportAllSettings(); @@ -310,7 +314,8 @@ Commit Hash: ${BuildConfig.commitHash}''', }, ), ListTile( - title: const Text('从剪贴板导入设置'), + dense: true, + title: const Text('从剪贴板导入设置', style: style), onTap: () async { Get.back(); ClipboardData? data = @@ -368,16 +373,13 @@ Commit Hash: ${BuildConfig.commitHash}''', onTap: () => showDialog( context: context, builder: (context) { - return AlertDialog( - title: const Text('重置所有设置'), - content: const Text('是否重置所有设置?'), - actions: [ - TextButton( - onPressed: Get.back, - child: const Text('取消'), - ), - TextButton( - onPressed: () async { + return SimpleDialog( + clipBehavior: Clip.hardEdge, + title: const Text('是否重置所有设置?'), + children: [ + ListTile( + dense: true, + onTap: () async { Get.back(); await Future.wait([ GStorage.setting.clear(), @@ -385,10 +387,11 @@ Commit Hash: ${BuildConfig.commitHash}''', ]); SmartDialog.showToast('重置成功'); }, - child: const Text('重置可导出的设置'), + title: const Text('重置可导出的设置', style: style), ), - TextButton( - onPressed: () async { + ListTile( + dense: true, + onTap: () async { Get.back(); await Future.wait([ GStorage.userInfo.clear(), @@ -400,7 +403,7 @@ Commit Hash: ${BuildConfig.commitHash}''', ]); SmartDialog.showToast('重置成功'); }, - child: const Text('重置所有数据(含登录信息)'), + title: const Text('重置所有数据(含登录信息)', style: style), ), ], ); diff --git a/lib/pages/history/base_controller.dart b/lib/pages/history/base_controller.dart index c315f30c..2d9eff9e 100644 --- a/lib/pages/history/base_controller.dart +++ b/lib/pages/history/base_controller.dart @@ -20,7 +20,13 @@ class HistoryBaseController extends GetxController { title: const Text('提示'), content: const Text('啊叻?你要清空历史记录功能吗?'), actions: [ - TextButton(onPressed: Get.back, child: const Text('取消')), + TextButton( + onPressed: Get.back, + child: Text( + '取消', + style: TextStyle(color: Theme.of(context).colorScheme.outline), + ), + ), TextButton( onPressed: () async { Get.back(); @@ -33,7 +39,7 @@ class HistoryBaseController extends GetxController { } }, child: const Text('确认清空'), - ) + ), ], ); }, @@ -50,7 +56,13 @@ class HistoryBaseController extends GetxController { content: Text(!pauseStatus.value ? '啊叻?你要暂停历史记录功能吗?' : '啊叻?要恢复历史记录功能吗?'), actions: [ - TextButton(onPressed: Get.back, child: const Text('取消')), + TextButton( + onPressed: Get.back, + child: Text( + '取消', + style: TextStyle(color: Theme.of(context).colorScheme.outline), + ), + ), TextButton( onPressed: () async { SmartDialog.showLoading(msg: '请求中'); @@ -66,7 +78,7 @@ class HistoryBaseController extends GetxController { Get.back(); }, child: Text(!pauseStatus.value ? '确认暂停' : '确认恢复'), - ) + ), ], ); }, diff --git a/lib/pages/later/widgets/video_card_h_later.dart b/lib/pages/later/widgets/video_card_h_later.dart index 7c2c0d3f..eb7cab04 100644 --- a/lib/pages/later/widgets/video_card_h_later.dart +++ b/lib/pages/later/widgets/video_card_h_later.dart @@ -94,11 +94,19 @@ class VideoCardHLater extends StatelessWidget { width: maxWidth, height: maxHeight, ), - PBadge( - text: videoItem.pgcLabel, - top: 6.0, - right: 6.0, - ), + if (videoItem.isCharging == true) + const PBadge( + text: '充电专属', + top: 6.0, + right: 6.0, + type: PBadgeType.error, + ) + else if (videoItem.pgcLabel != null) + PBadge( + text: videoItem.pgcLabel, + top: 6.0, + right: 6.0, + ), if (progress != null && progress != 0) ...[ PBadge( text: progress == -1 diff --git a/lib/pages/setting/pages/play_speed_set.dart b/lib/pages/setting/pages/play_speed_set.dart index 78310109..bfa353cc 100644 --- a/lib/pages/setting/pages/play_speed_set.dart +++ b/lib/pages/setting/pages/play_speed_set.dart @@ -85,7 +85,10 @@ class _PlaySpeedPageState extends State { actions: [ TextButton( onPressed: Get.back, - child: const Text('取消'), + child: Text( + '取消', + style: TextStyle(color: Theme.of(context).colorScheme.outline), + ), ), TextButton( onPressed: () { diff --git a/lib/pages/video/introduction/ugc/view.dart b/lib/pages/video/introduction/ugc/view.dart index 6f70b931..dc38ea68 100644 --- a/lib/pages/video/introduction/ugc/view.dart +++ b/lib/pages/video/introduction/ugc/view.dart @@ -132,79 +132,102 @@ class _VideoInfoState extends State { late final _horizontalMemberPage = Pref.horizontalMemberPage; - Widget _buildVideoTitle(ThemeData theme, [bool isExpand = false]) => - videoDetailCtr.plPlayerController.enableSponsorBlock - ? Obx( - () => Text.rich( - TextSpan( - children: [ - if (videoDetailCtr.videoLabel.value.isNotEmpty) ...[ - WidgetSpan( - alignment: PlaceholderAlignment.middle, - child: Container( - padding: const EdgeInsets.symmetric( - horizontal: 4, - vertical: 2, - ), - decoration: BoxDecoration( - color: theme.colorScheme.secondaryContainer, - borderRadius: - const BorderRadius.all(Radius.circular(4)), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Stack( - clipBehavior: Clip.none, - alignment: Alignment.center, - children: [ - Icon( - Icons.shield_outlined, - size: 16, - color: - theme.colorScheme.onSecondaryContainer, - ), - Icon( - Icons.play_arrow_rounded, - size: 12, - color: - theme.colorScheme.onSecondaryContainer, - ), - ], - ), - Text( - videoDetailCtr.videoLabel.value, - textScaler: TextScaler.noScaling, - strutStyle: - const StrutStyle(leading: 0, height: 1), - style: TextStyle( - height: 1, - fontSize: 13, - color: theme.colorScheme.onSecondaryContainer, - ), - ), - ], + Widget _buildVideoTitle(ThemeData theme, [bool isExpand = false]) { + late final isDark = theme.brightness == Brightness.dark; + Widget child() => Text.rich( + TextSpan( + children: [ + if (videoDetailCtr.videoLabel.value.isNotEmpty) ...[ + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 4, + vertical: 2, + ), + decoration: BoxDecoration( + color: theme.colorScheme.secondaryContainer, + borderRadius: const BorderRadius.all(Radius.circular(4)), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Stack( + clipBehavior: Clip.none, + alignment: Alignment.center, + children: [ + Icon( + Icons.shield_outlined, + size: 16, + color: theme.colorScheme.onSecondaryContainer, + ), + Icon( + Icons.play_arrow_rounded, + size: 12, + color: theme.colorScheme.onSecondaryContainer, + ), + ], + ), + Text( + videoDetailCtr.videoLabel.value, + textScaler: TextScaler.noScaling, + strutStyle: const StrutStyle(leading: 0, height: 1), + style: TextStyle( + height: 1, + fontSize: 13, + color: theme.colorScheme.onSecondaryContainer, ), ), - ), - const TextSpan(text: ' '), - ], - TextSpan( - text: - '${videoDetail.title ?? videoItem['title'] ?? ''}'), - ], + ], + ), + ), ), - maxLines: isExpand ? null : 2, - overflow: isExpand ? null : TextOverflow.ellipsis, - style: const TextStyle(fontSize: 16), - ), - ) - : Text( - '${videoDetail.title ?? videoItem['title'] ?? ''}', - maxLines: isExpand ? null : 2, - overflow: isExpand ? null : TextOverflow.ellipsis, - style: const TextStyle(fontSize: 16), - ); + const TextSpan(text: ' '), + ], + if (videoDetail.isUpowerExclusive == true) ...[ + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 4, + vertical: 2, + ), + decoration: BoxDecoration( + color: isDark + ? theme.colorScheme.error + : theme.colorScheme.errorContainer, + borderRadius: const BorderRadius.all(Radius.circular(4)), + ), + child: Text( + '充电专属', + textScaler: TextScaler.noScaling, + strutStyle: const StrutStyle(leading: 0, height: 1), + style: TextStyle( + height: 1, + fontSize: 12, + fontWeight: FontWeight.bold, + color: isDark + ? theme.colorScheme.onError + : theme.colorScheme.onErrorContainer, + ), + ), + ), + ), + const TextSpan(text: ' '), + ], + TextSpan( + text: '${videoDetail.title ?? videoItem['title'] ?? ''}'), + ], + ), + maxLines: isExpand ? null : 2, + overflow: isExpand ? null : TextOverflow.ellipsis, + style: const TextStyle(fontSize: 16), + ); + if (videoDetailCtr.plPlayerController.enableSponsorBlock) { + return Obx(child); + } + return child(); + } Future handleState(FutureOr Function() action) async { if (!isProcessing) { diff --git a/lib/pages/webview/view.dart b/lib/pages/webview/view.dart index f8f50b66..b74ecf18 100644 --- a/lib/pages/webview/view.dart +++ b/lib/pages/webview/view.dart @@ -239,7 +239,12 @@ class _WebviewPageState extends State { actions: [ TextButton( onPressed: Get.back, - child: const Text('取消'), + child: Text( + '取消', + style: TextStyle( + color: + Theme.of(context).colorScheme.outline), + ), ), TextButton( onPressed: () {