diff --git a/lib/http/video.dart b/lib/http/video.dart index b576feb0c..3b69a8b5b 100644 --- a/lib/http/video.dart +++ b/lib/http/video.dart @@ -187,7 +187,7 @@ class VideoHttp { } // 视频流 - static Future videoUrl({ + static Future> videoUrl({ int? avid, String? bvid, required int cid, @@ -238,31 +238,33 @@ class VideoHttp { ..lastPlayTime = result?['play_view_business_info']?['user_status']?['watch_progress']?['current_watch_progress']; } - return {'status': true, 'data': data}; - } else { - if (epid != null && videoType == VideoType.ugc) { - return videoUrl( - avid: avid, - bvid: bvid, - cid: cid, - qn: qn, - epid: epid, - seasonId: seasonId, - tryLook: tryLook, - videoType: VideoType.pgc, - ); - } - return { - 'status': false, - 'code': res.data['code'], - 'msg': res.data['message'], - }; + return Success(data); + } else if (epid != null && videoType == VideoType.ugc) { + return videoUrl( + avid: avid, + bvid: bvid, + cid: cid, + qn: qn, + epid: epid, + seasonId: seasonId, + tryLook: tryLook, + videoType: VideoType.pgc, + ); } + return Error(_parseVideoErr(res.data['code'], res.data['message'])); } catch (err) { - return {'status': false, 'msg': err.toString()}; + return Error(err.toString()); } } + static String _parseVideoErr(int? code, String? msg) { + return switch (code) { + -404 => '视频不存在或已被删除', + 87008 => '当前视频可能是专属视频,可能需包月充电观看($msg})', + _ => '错误($code): $msg', + }; + } + // 视频信息 标题、简介 static Future> videoIntro({ required String bvid, diff --git a/lib/pages/live_room/view.dart b/lib/pages/live_room/view.dart index 20346b4c6..3420dbf00 100644 --- a/lib/pages/live_room/view.dart +++ b/lib/pages/live_room/view.dart @@ -20,6 +20,7 @@ import 'package:PiliPlus/utils/extension.dart'; import 'package:PiliPlus/utils/page_utils.dart'; import 'package:PiliPlus/utils/storage.dart'; import 'package:PiliPlus/utils/storage_key.dart'; +import 'package:PiliPlus/utils/storage_pref.dart'; import 'package:PiliPlus/utils/utils.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:canvas_danmaku/canvas_danmaku.dart'; @@ -558,10 +559,12 @@ class _LiveRoomPageState extends State onPressed: () { final newVal = !enableShowDanmaku; plPlayerController.enableShowDanmaku.value = newVal; - GStorage.setting.put( - SettingBoxKey.enableShowDanmaku, - newVal, - ); + if (!Pref.tempPlayerConf) { + GStorage.setting.put( + SettingBoxKey.enableShowDanmaku, + newVal, + ); + } }, icon: Icon( enableShowDanmaku diff --git a/lib/pages/live_room/widgets/bottom_control.dart b/lib/pages/live_room/widgets/bottom_control.dart index 803626e55..127737e02 100644 --- a/lib/pages/live_room/widgets/bottom_control.dart +++ b/lib/pages/live_room/widgets/bottom_control.dart @@ -4,6 +4,7 @@ import 'package:PiliPlus/plugin/pl_player/widgets/common_btn.dart'; import 'package:PiliPlus/plugin/pl_player/widgets/play_pause_btn.dart'; import 'package:PiliPlus/utils/storage.dart'; import 'package:PiliPlus/utils/storage_key.dart'; +import 'package:PiliPlus/utils/storage_pref.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; @@ -88,10 +89,12 @@ class BottomControl extends StatelessWidget { onPressed: () { final newVal = !enableShowDanmaku; plPlayerController.enableShowDanmaku.value = newVal; - GStorage.setting.put( - SettingBoxKey.enableShowDanmaku, - newVal, - ); + if (!Pref.tempPlayerConf) { + GStorage.setting.put( + SettingBoxKey.enableShowDanmaku, + newVal, + ); + } }, icon: Icon( size: 18, diff --git a/lib/pages/setting/extra_setting.dart b/lib/pages/setting/extra_setting.dart index e19ee0d96..b6ded4596 100644 --- a/lib/pages/setting/extra_setting.dart +++ b/lib/pages/setting/extra_setting.dart @@ -1,5 +1,4 @@ import 'package:PiliPlus/pages/setting/models/extra_settings.dart'; -import 'package:PiliPlus/pages/setting/models/model.dart'; import 'package:flutter/material.dart'; class ExtraSetting extends StatefulWidget { diff --git a/lib/pages/setting/models/extra_settings.dart b/lib/pages/setting/models/extra_settings.dart index c5ef41fe4..50039a36c 100644 --- a/lib/pages/setting/models/extra_settings.dart +++ b/lib/pages/setting/models/extra_settings.dart @@ -119,52 +119,52 @@ List get extraSettings => [ setKey: SettingBoxKey.showViewPoints, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '视频页显示相关视频', - leading: const Icon(MdiIcons.motionPlayOutline), + leading: Icon(MdiIcons.motionPlayOutline), setKey: SettingBoxKey.showRelatedVideo, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '显示视频评论', - leading: const Icon(MdiIcons.commentTextOutline), + leading: Icon(MdiIcons.commentTextOutline), setKey: SettingBoxKey.showVideoReply, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '显示番剧评论', - leading: const Icon(MdiIcons.commentTextOutline), + leading: Icon(MdiIcons.commentTextOutline), setKey: SettingBoxKey.showBangumiReply, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '默认展开视频简介', - leading: const Icon(Icons.expand_more), + leading: Icon(Icons.expand_more), setKey: SettingBoxKey.alwaysExapndIntroPanel, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '横屏自动展开视频简介', - leading: const Icon(Icons.expand_more), + leading: Icon(Icons.expand_more), setKey: SettingBoxKey.exapndIntroPanelH, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '横屏分P/合集列表显示在Tab栏', - leading: const Icon(Icons.format_list_numbered_rtl_sharp), + leading: Icon(Icons.format_list_numbered_rtl_sharp), setKey: SettingBoxKey.horizontalSeasonPanel, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '横屏播放页在侧栏打开UP主页', - leading: const Icon(Icons.account_circle_outlined), + leading: Icon(Icons.account_circle_outlined), setKey: SettingBoxKey.horizontalMemberPage, defaultVal: false, ), @@ -284,40 +284,40 @@ List get extraSettings => [ ); }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '显示视频警告/争议信息', - leading: const Icon(Icons.warning_amber_rounded), + leading: Icon(Icons.warning_amber_rounded), setKey: SettingBoxKey.showArgueMsg, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '分P/合集:倒序播放从首集开始播放', subtitle: '开启则自动切换为倒序首集,否则保持当前集', - leading: const Icon(MdiIcons.sort), + leading: Icon(MdiIcons.sort), setKey: SettingBoxKey.reverseFromFirst, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '禁用 SSL 证书验证', subtitle: '谨慎开启,禁用容易受到中间人攻击', - leading: const Icon(Icons.security), + leading: Icon(Icons.security), needReboot: true, setKey: SettingBoxKey.badCertificateCallback, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '显示继续播放分P提示', - leading: const Icon(Icons.local_parking), + leading: Icon(Icons.local_parking), setKey: SettingBoxKey.continuePlayingPart, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '横屏在侧栏打开图片预览', - leading: const Icon(Icons.photo_outlined), + leading: Icon(Icons.photo_outlined), setKey: SettingBoxKey.horizontalPreview, defaultVal: false, ), @@ -339,10 +339,10 @@ List get extraSettings => [ DynamicsDataModel.enableFilter = value.pattern.isNotEmpty; }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '使用外部浏览器打开链接', - leading: const Icon(Icons.open_in_browser), + leading: Icon(Icons.open_in_browser), setKey: SettingBoxKey.openInBrowser, defaultVal: false, ), @@ -402,25 +402,25 @@ List get extraSettings => [ } }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '显示会员彩色弹幕', - leading: const Icon(MdiIcons.gradientHorizontal), + leading: Icon(MdiIcons.gradientHorizontal), setKey: SettingBoxKey.showVipDanmaku, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '显示高级弹幕', - leading: const Icon(MdiIcons.paletteAdvanced), + leading: Icon(MdiIcons.paletteAdvanced), setKey: SettingBoxKey.showSpecialDanmaku, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '合并弹幕', subtitle: '合并一段时间内获取到的相同弹幕', - leading: const Icon(Icons.merge), + leading: Icon(Icons.merge), setKey: SettingBoxKey.mergeDanmaku, defaultVal: false, ), @@ -550,33 +550,33 @@ List get extraSettings => [ } }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '提前初始化播放器', subtitle: '相对减少手动播放加载时间', - leading: const Icon(Icons.play_circle_outlined), + leading: Icon(Icons.play_circle_outlined), setKey: SettingBoxKey.preInitPlayer, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '首页切换页面动画', - leading: const Icon(Icons.home_outlined), + leading: Icon(Icons.home_outlined), setKey: SettingBoxKey.mainTabBarView, defaultVal: false, needReboot: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '搜索建议', - leading: const Icon(Icons.search), + leading: Icon(Icons.search), setKey: SettingBoxKey.searchSuggestion, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '记录搜索历史', - leading: const Icon(Icons.history), + leading: Icon(Icons.history), setKey: SettingBoxKey.recordSearchHistory, defaultVal: true, ), @@ -599,26 +599,26 @@ List get extraSettings => [ ImageModel.enableLivePhoto = value; }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '滑动跳转预览视频缩略图', - leading: const Icon(Icons.preview_outlined), + leading: Icon(Icons.preview_outlined), setKey: SettingBoxKey.showSeekPreview, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '显示高能进度条', subtitle: '高能进度条反应了在时域上,单位时间内弹幕发送量的变化趋势', - leading: const Icon(Icons.show_chart), + leading: Icon(Icons.show_chart), setKey: SettingBoxKey.showDmChart, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '发评反诈', subtitle: '发送评论后检查评论是否可见', - leading: const Stack( + leading: Stack( clipBehavior: Clip.none, alignment: Alignment.center, children: [ @@ -629,22 +629,22 @@ List get extraSettings => [ setKey: SettingBoxKey.enableCommAntifraud, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '使用「哔哩发评反诈」检查评论', subtitle: '仅对Android生效', - leading: const Icon( + leading: Icon( FontAwesomeIcons.b, size: 22, ), setKey: SettingBoxKey.biliSendCommAntifraud, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '发布/转发动态反诈', subtitle: '发布/转发动态后检查动态是否可见', - leading: const Stack( + leading: Stack( clipBehavior: Clip.none, alignment: Alignment.center, children: [ @@ -702,31 +702,31 @@ List get extraSettings => [ CommonSlidePageState.slideDismissReplyPage = value; }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '启用双指缩小视频', - leading: const Icon(Icons.pinch), + leading: Icon(Icons.pinch), setKey: SettingBoxKey.enableShrinkVideoSize, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '动态/专栏详情页展示底部操作栏', - leading: const Icon(Icons.more_horiz), + leading: Icon(Icons.more_horiz), setKey: SettingBoxKey.showDynActionBar, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '启用拖拽字幕调整底部边距', - leading: const Icon(MdiIcons.dragVariant), + leading: Icon(MdiIcons.dragVariant), setKey: SettingBoxKey.enableDragSubtitle, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '展示追番时间表', - leading: const Icon(MdiIcons.chartTimelineVariantShimmer), + leading: Icon(MdiIcons.chartTimelineVariantShimmer), setKey: SettingBoxKey.showPgcTimeline, defaultVal: true, needReboot: true, @@ -742,19 +742,19 @@ List get extraSettings => [ title: '震动反馈', subtitle: '请确定手机设置中已开启震动反馈', ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '大家都在搜', subtitle: '是否展示「大家都在搜」', - leading: const Icon(Icons.data_thresholding_outlined), + leading: Icon(Icons.data_thresholding_outlined), setKey: SettingBoxKey.enableHotKey, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '搜索发现', subtitle: '是否展示「搜索发现」', - leading: const Icon(Icons.search_outlined), + leading: Icon(Icons.search_outlined), setKey: SettingBoxKey.enableSearchRcmd, defaultVal: true, ), @@ -836,34 +836,34 @@ List get extraSettings => [ ReplyItemGrpc.enableWordRe = value; }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '启用AI总结', subtitle: '视频详情页开启AI总结', - leading: const Icon(Icons.engineering_outlined), + leading: Icon(Icons.engineering_outlined), setKey: SettingBoxKey.enableAi, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '消息页禁用"收到的赞"功能', subtitle: '禁止打开入口,降低网络社交依赖', - leading: const Icon(Icons.beach_access_outlined), + leading: Icon(Icons.beach_access_outlined), setKey: SettingBoxKey.disableLikeMsg, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '默认展示评论区', subtitle: '在视频详情页默认切换至评论区页(仅Tab型布局)', - leading: const Icon(Icons.mode_comment_outlined), + leading: Icon(Icons.mode_comment_outlined), setKey: SettingBoxKey.defaultShowComment, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '启用HTTP/2', - leading: const Icon(Icons.swap_horizontal_circle_outlined), + leading: Icon(Icons.swap_horizontal_circle_outlined), setKey: SettingBoxKey.enableHttp2, defaultVal: false, needReboot: true, @@ -1081,11 +1081,11 @@ List get extraSettings => [ subtitle: '设置代理 host:port', setKey: SettingBoxKey.enableSystemProxy, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '自动清除缓存', subtitle: '每次启动时清除缓存', - leading: const Icon(Icons.auto_delete_outlined), + leading: Icon(Icons.auto_delete_outlined), setKey: SettingBoxKey.autoClearCache, defaultVal: false, ), diff --git a/lib/pages/setting/models/model.dart b/lib/pages/setting/models/model.dart index e2d12dd6c..92b199309 100644 --- a/lib/pages/setting/models/model.dart +++ b/lib/pages/setting/models/model.dart @@ -8,7 +8,40 @@ import 'package:flutter/services.dart' show FilteringTextInputFormatter; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; -extension SettingsModelExt on SettingsModel { +@immutable +class SettingsModel { + final SettingsType settingsType; + final String? title; + final StringGetter? getTitle; + final String? subtitle; + final StringGetter? getSubtitle; + final String? setKey; + final bool? defaultVal; + final ValueChanged? onChanged; + final bool? needReboot; + final Widget? leading; + final Widget Function()? getTrailing; + final Function? onTap; + final EdgeInsetsGeometry? contentPadding; + final TextStyle? titleStyle; + + const SettingsModel({ + required this.settingsType, + this.title, + this.getTitle, + this.subtitle, + this.getSubtitle, + this.setKey, + this.defaultVal, + this.onChanged, + this.needReboot, + this.leading, + this.getTrailing, + this.onTap, + this.contentPadding, + this.titleStyle, + }) : assert(title != null || getTitle != null); + Widget get widget => switch (settingsType) { SettingsType.normal => NormalItem( title: title, @@ -40,40 +73,6 @@ extension SettingsModelExt on SettingsModel { }; } -class SettingsModel { - final SettingsType settingsType; - final String? title; - final Function? getTitle; - final String? subtitle; - final Function? getSubtitle; - final String? setKey; - final bool? defaultVal; - final ValueChanged? onChanged; - final bool? needReboot; - final Widget? leading; - final Function? getTrailing; - final Function? onTap; - final EdgeInsetsGeometry? contentPadding; - final TextStyle? titleStyle; - - SettingsModel({ - required this.settingsType, - this.title, - this.getTitle, - this.subtitle, - this.getSubtitle, - this.setKey, - this.defaultVal, - this.onChanged, - this.needReboot, - this.leading, - this.getTrailing, - this.onTap, - this.contentPadding, - this.titleStyle, - }); -} - SettingsModel getBanwordModel({ required BuildContext context, required String title, diff --git a/lib/pages/setting/models/play_settings.dart b/lib/pages/setting/models/play_settings.dart index 9f4f7ac07..888cabf5b 100644 --- a/lib/pages/setting/models/play_settings.dart +++ b/lib/pages/setting/models/play_settings.dart @@ -19,11 +19,11 @@ import 'package:get/get.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; List get playSettings => [ - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '弹幕开关', subtitle: '是否展示弹幕', - leading: const Icon(CustomIcon.dm_settings), + leading: Icon(CustomIcon.dm_settings), setKey: SettingBoxKey.enableShowDanmaku, defaultVal: true, ), @@ -34,33 +34,33 @@ List get playSettings => [ title: '倍速设置', subtitle: '设置视频播放速度', ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '自动播放', subtitle: '进入详情页自动播放', - leading: const Icon(Icons.motion_photos_auto_outlined), + leading: Icon(Icons.motion_photos_auto_outlined), setKey: SettingBoxKey.autoPlayEnable, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '双击快退/快进', subtitle: '左侧双击快退/右侧双击快进,关闭则双击均为暂停/播放', - leading: const Icon(Icons.touch_app_outlined), + leading: Icon(Icons.touch_app_outlined), setKey: SettingBoxKey.enableQuickDouble, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '左右侧滑动调节亮度/音量', - leading: const Icon(MdiIcons.tuneVerticalVariant), + leading: Icon(MdiIcons.tuneVerticalVariant), setKey: SettingBoxKey.enableSlideVolumeBrightness, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '中间滑动进入/退出全屏', - leading: const Icon(MdiIcons.panVertical), + leading: Icon(MdiIcons.panVertical), setKey: SettingBoxKey.enableSlideFS, defaultVal: true, ), @@ -73,10 +73,10 @@ List get playSettings => [ defaultValue: 10, isFilter: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '滑动快进/快退使用相对时长', - leading: const Icon(Icons.swap_horiz_outlined), + leading: Icon(Icons.swap_horiz_outlined), setKey: SettingBoxKey.useRelativeSlide, defaultVal: false, ), @@ -115,35 +115,35 @@ List get playSettings => [ } }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '竖屏扩大展示', subtitle: '小屏竖屏视频宽高比由16:9扩大至1:1(不支持收起);横屏适配时,扩大至9:16', - leading: const Icon(Icons.expand_outlined), + leading: Icon(Icons.expand_outlined), setKey: SettingBoxKey.enableVerticalExpand, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '自动全屏', subtitle: '视频开始播放时进入全屏', - leading: const Icon(Icons.fullscreen_outlined), + leading: Icon(Icons.fullscreen_outlined), setKey: SettingBoxKey.enableAutoEnter, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '自动退出全屏', subtitle: '视频结束播放时退出全屏', - leading: const Icon(Icons.fullscreen_exit_outlined), + leading: Icon(Icons.fullscreen_exit_outlined), setKey: SettingBoxKey.enableAutoExit, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '延长播放控件显示时间', subtitle: '开启后延长至30秒,便于屏幕阅读器滑动切换控件焦点', - leading: const Icon(Icons.timer_outlined), + leading: Icon(Icons.timer_outlined), setKey: SettingBoxKey.enableLongShowControl, defaultVal: false, ), @@ -156,11 +156,11 @@ List get playSettings => [ defaultVal: true, onChanged: (value) => allowRotateScreen = value, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '后台播放', subtitle: '进入后台时继续播放', - leading: const Icon(Icons.motion_photos_pause_outlined), + leading: Icon(Icons.motion_photos_pause_outlined), setKey: SettingBoxKey.continuePlayInBackground, defaultVal: false, ), @@ -178,35 +178,35 @@ List get playSettings => [ } }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '画中画不加载弹幕', subtitle: '当弹幕开关开启时,小窗屏蔽弹幕以获得较好的体验', - leading: const Icon(Icons.subtitles_off_outlined), + leading: Icon(Icons.subtitles_off_outlined), setKey: SettingBoxKey.pipNoDanmaku, defaultVal: false, ), ], - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '全屏手势反向', subtitle: '默认播放器中部向上滑动进入全屏,向下退出\n开启后向下全屏,向上退出', - leading: const Icon(Icons.swap_vert_outlined), + leading: Icon(Icons.swap_vert_outlined), setKey: SettingBoxKey.fullScreenGestureReverse, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '全屏展示点赞/投币/收藏等操作按钮', - leading: const Icon(MdiIcons.dotsHorizontalCircleOutline), + leading: Icon(MdiIcons.dotsHorizontalCircleOutline), setKey: SettingBoxKey.showFSActionItem, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '观看人数', subtitle: '展示同时在看人数', - leading: const Icon(Icons.people_outlined), + leading: Icon(Icons.people_outlined), setKey: SettingBoxKey.enableOnlineTotal, defaultVal: false, ), @@ -271,4 +271,12 @@ List get playSettings => [ videoPlayerServiceHandler.enableBackgroundPlay = value; }, ), + const SettingsModel( + settingsType: SettingsType.sw1tch, + title: '播放器设置仅对当前生效', + subtitle: '弹幕、字幕及部分设置中没有的设置除外', + leading: Icon(Icons.video_settings_outlined), + setKey: SettingBoxKey.tempPlayerConf, + defaultVal: false, + ), ]; diff --git a/lib/pages/setting/models/recommend_settings.dart b/lib/pages/setting/models/recommend_settings.dart index b26b08184..2bfa2e427 100644 --- a/lib/pages/setting/models/recommend_settings.dart +++ b/lib/pages/setting/models/recommend_settings.dart @@ -9,20 +9,20 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; List get recommendSettings => [ - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '首页使用app端推荐', subtitle: '若web端推荐不太符合预期,可尝试切换至app端推荐', - leading: const Icon(Icons.model_training_outlined), + leading: Icon(Icons.model_training_outlined), setKey: SettingBoxKey.appRcmd, defaultVal: true, needReboot: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '推荐动态', subtitle: '是否在推荐内容中展示动态(仅app端)', - leading: const Icon(Icons.motion_photos_on_outlined), + leading: Icon(Icons.motion_photos_on_outlined), setKey: SettingBoxKey.enableRcmdDynamic, defaultVal: true, ), diff --git a/lib/pages/setting/models/style_settings.dart b/lib/pages/setting/models/style_settings.dart index 09a686672..00cea1bc5 100644 --- a/lib/pages/setting/models/style_settings.dart +++ b/lib/pages/setting/models/style_settings.dart @@ -47,11 +47,11 @@ List get styleSettings => [ } }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '改用侧边栏', subtitle: '开启后底栏与顶栏被替换,且相关设置失效', - leading: const Icon(Icons.chrome_reader_mode_outlined), + leading: Icon(Icons.chrome_reader_mode_outlined), setKey: SettingBoxKey.useSideBar, defaultVal: false, needReboot: true, @@ -115,19 +115,19 @@ List get styleSettings => [ } }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '优化平板导航栏', - leading: const Icon(MdiIcons.soundbar), + leading: Icon(MdiIcons.soundbar), setKey: SettingBoxKey.optTabletNav, defaultVal: true, needReboot: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: 'MD3样式底栏', subtitle: 'Material You设计规范底栏,关闭可变窄', - leading: const Icon(Icons.design_services_outlined), + leading: Icon(Icons.design_services_outlined), setKey: SettingBoxKey.enableMYBar, defaultVal: true, needReboot: true, @@ -171,19 +171,19 @@ List get styleSettings => [ } }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '播放页移除安全边距', subtitle: '隐藏状态栏、撑满屏幕,但播放控件仍处于安全域内', - leading: const Icon(Icons.fit_screen_outlined), + leading: Icon(Icons.fit_screen_outlined), setKey: SettingBoxKey.videoPlayerRemoveSafeArea, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '动态页启用瀑布流', subtitle: '关闭会显示为单列', - leading: const Icon(Icons.view_array_outlined), + leading: Icon(Icons.view_array_outlined), setKey: SettingBoxKey.dynamicsWaterfallFlow, defaultVal: true, needReboot: true, @@ -213,17 +213,17 @@ List get styleSettings => [ } }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '动态页显示所有已关注UP主', - leading: const Icon(Icons.people_alt_outlined), + leading: Icon(Icons.people_alt_outlined), setKey: SettingBoxKey.dynamicsShowAllFollowedUp, defaultVal: false, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '动态页展开正在直播UP列表', - leading: const Icon(Icons.live_tv), + leading: Icon(Icons.live_tv), setKey: SettingBoxKey.expandDynLivePanel, defaultVal: false, ), @@ -324,20 +324,20 @@ List get styleSettings => [ getSubtitle: () => '当前消息类型:${Pref.msgUnReadTypeV2.map((item) => item.title).join('、')}', ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '首页顶栏收起', subtitle: '首页列表滑动时,收起顶栏', - leading: const Icon(Icons.vertical_align_top_outlined), + leading: Icon(Icons.vertical_align_top_outlined), setKey: SettingBoxKey.hideSearchBar, defaultVal: true, needReboot: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '首页底栏收起', subtitle: '首页列表滑动时,收起底栏', - leading: const Icon(Icons.vertical_align_bottom_outlined), + leading: Icon(Icons.vertical_align_bottom_outlined), setKey: SettingBoxKey.hideTabBar, defaultVal: true, needReboot: true, diff --git a/lib/pages/setting/models/video_settings.dart b/lib/pages/setting/models/video_settings.dart index 0e61d8a4a..e62cb3d82 100644 --- a/lib/pages/setting/models/video_settings.dart +++ b/lib/pages/setting/models/video_settings.dart @@ -17,19 +17,19 @@ import 'package:get/get.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; List get videoSettings => [ - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '开启硬解', subtitle: '以较低功耗播放视频,若异常卡死请关闭', - leading: const Icon(Icons.flash_on_outlined), + leading: Icon(Icons.flash_on_outlined), setKey: SettingBoxKey.enableHA, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '免登录1080P', subtitle: '免登录查看1080P视频', - leading: const Icon(Icons.hd_outlined), + leading: Icon(Icons.hd_outlined), setKey: SettingBoxKey.p1080, defaultVal: true, ), @@ -75,10 +75,10 @@ List get videoSettings => [ } }, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: 'CDN 测速', - leading: const Icon(Icons.speed), + leading: Icon(Icons.speed), subtitle: '测速通过模拟加载视频实现,注意流量消耗,结果仅供参考', setKey: SettingBoxKey.cdnSpeedTest, defaultVal: true, @@ -301,18 +301,18 @@ List get videoSettings => [ }, ), if (Platform.isAndroid) - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '优先使用 OpenSL ES 输出音频', - leading: const Icon(Icons.speaker_outlined), + leading: Icon(Icons.speaker_outlined), subtitle: '关闭则优先使用AudioTrack输出音频(此项即mpv的--ao),若遇系统音效丢失、无声、音画不同步等问题请尝试关闭。', setKey: SettingBoxKey.useOpenSLES, defaultVal: true, ), - SettingsModel( + const SettingsModel( settingsType: SettingsType.sw1tch, title: '扩大缓冲区', - leading: const Icon(Icons.storage_outlined), + leading: Icon(Icons.storage_outlined), subtitle: '默认缓冲区为视频4MB/直播16MB,开启后为32MB/64MB,加载时间变长', setKey: SettingBoxKey.expandBuffer, defaultVal: false, diff --git a/lib/pages/setting/play_setting.dart b/lib/pages/setting/play_setting.dart index ddd42c222..489129771 100644 --- a/lib/pages/setting/play_setting.dart +++ b/lib/pages/setting/play_setting.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/pages/setting/models/model.dart'; import 'package:PiliPlus/pages/setting/models/play_settings.dart'; import 'package:flutter/material.dart'; diff --git a/lib/pages/setting/privacy_setting.dart b/lib/pages/setting/privacy_setting.dart index 8f4490b7f..3d63a550b 100644 --- a/lib/pages/setting/privacy_setting.dart +++ b/lib/pages/setting/privacy_setting.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/pages/setting/models/model.dart'; import 'package:PiliPlus/pages/setting/models/privacy_settings.dart'; import 'package:flutter/material.dart'; diff --git a/lib/pages/setting/style_setting.dart b/lib/pages/setting/style_setting.dart index a8077ff0b..79b24d648 100644 --- a/lib/pages/setting/style_setting.dart +++ b/lib/pages/setting/style_setting.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/pages/setting/models/model.dart'; import 'package:PiliPlus/pages/setting/models/style_settings.dart'; import 'package:flutter/material.dart'; diff --git a/lib/pages/setting/video_setting.dart b/lib/pages/setting/video_setting.dart index ac72e6288..0a01df6d3 100644 --- a/lib/pages/setting/video_setting.dart +++ b/lib/pages/setting/video_setting.dart @@ -1,4 +1,3 @@ -import 'package:PiliPlus/pages/setting/models/model.dart'; import 'package:PiliPlus/pages/setting/models/video_settings.dart'; import 'package:flutter/material.dart'; diff --git a/lib/pages/setting/widgets/normal_item.dart b/lib/pages/setting/widgets/normal_item.dart index 07731c088..5ea92a31a 100644 --- a/lib/pages/setting/widgets/normal_item.dart +++ b/lib/pages/setting/widgets/normal_item.dart @@ -1,16 +1,18 @@ import 'package:flutter/material.dart'; +typedef StringGetter = String Function(); + class NormalItem extends StatefulWidget { final String? title; - final Function? getTitle; + final StringGetter? getTitle; final String? subtitle; - final Function? getSubtitle; + final StringGetter? getSubtitle; final String? setKey; final bool? defaultVal; final ValueChanged? onChanged; final bool? needReboot; final Widget? leading; - final Function? getTrailing; + final Widget Function()? getTrailing; final Function? onTap; final EdgeInsetsGeometry? contentPadding; final TextStyle? titleStyle; @@ -30,7 +32,7 @@ class NormalItem extends StatefulWidget { this.contentPadding, this.titleStyle, super.key, - }); + }) : assert(title != null || getTitle != null); @override State createState() => _NormalItemState(); @@ -45,12 +47,12 @@ class _NormalItemState extends State { setState(() {}); }), title: Text( - widget.title ?? widget.getTitle?.call(), + widget.title ?? widget.getTitle!(), style: widget.titleStyle ?? Theme.of(context).textTheme.titleMedium!, ), subtitle: widget.subtitle != null || widget.getSubtitle != null ? Text( - widget.subtitle ?? widget.getSubtitle?.call(), + widget.subtitle ?? widget.getSubtitle!(), style: Theme.of(context).textTheme.labelMedium!.copyWith( color: Theme.of(context).colorScheme.outline, ), diff --git a/lib/pages/setting/widgets/select_dialog.dart b/lib/pages/setting/widgets/select_dialog.dart index 20abfcb19..ba292fe6f 100644 --- a/lib/pages/setting/widgets/select_dialog.dart +++ b/lib/pages/setting/widgets/select_dialog.dart @@ -27,10 +27,11 @@ class SelectDialog extends StatelessWidget { @override Widget build(BuildContext context) { + final titleMedium = Theme.of(context).textTheme.titleMedium!; return AlertDialog( clipBehavior: Clip.hardEdge, title: Text(title), - contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 12), + contentPadding: const EdgeInsets.symmetric(vertical: 12), content: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.min, @@ -43,7 +44,7 @@ class SelectDialog extends StatelessWidget { value: item.$1, title: Text( item.$2, - style: Theme.of(context).textTheme.titleMedium!, + style: titleMedium, ), subtitle: subtitleBuilder?.call(context, index), groupValue: value, @@ -106,8 +107,9 @@ class _CdnSelectDialogState extends State { tryLook: false, videoType: VideoType.ugc, ); - if (!result['status']) throw Exception('无法获取视频流'); - return result['data'].dash.video.first; + final item = result.dataOrNull?.dash?.video?.first; + if (item == null) throw Exception('无法获取视频流'); + return item; } Future _startSpeedTest() async { diff --git a/lib/pages/settings_search/view.dart b/lib/pages/settings_search/view.dart index ecfc2b1cf..f6bf4ac41 100644 --- a/lib/pages/settings_search/view.dart +++ b/lib/pages/settings_search/view.dart @@ -40,7 +40,7 @@ class _SettingsSearchPageState extends SearchState { _list.value = _settings .where( (item) => - (item.title ?? item.getTitle?.call())?.toLowerCase().contains( + (item.title ?? item.getTitle!()).toLowerCase().contains( value, ) || item.subtitle?.toLowerCase().contains(value) == true, diff --git a/lib/pages/video/controller.dart b/lib/pages/video/controller.dart index cb90a10d5..0cd715acd 100644 --- a/lib/pages/video/controller.dart +++ b/lib/pages/video/controller.dart @@ -1177,8 +1177,8 @@ class VideoDetailController extends GetxController videoType: _actualVideoType ?? videoType, ); - if (result['status']) { - data = result['data']; + if (result.isSuccess) { + data = result.data; if (data.acceptDesc?.contains('试看') == true) { SmartDialog.showToast( @@ -1338,18 +1338,10 @@ class VideoDetailController extends GetxController } } else { autoPlay.value = false; - videoState.value = Error(result['msg']); + videoState.value = result..toast(); if (plPlayerController.isFullScreen.value) { plPlayerController.toggleFullScreen(false); } - final code = result['code']; - if (code == -404) { - SmartDialog.showToast('视频不存在或已被删除'); - } else if (code == 87008) { - SmartDialog.showToast("当前视频可能是专属视频,可能需包月充电观看(${result['msg']})"); - } else { - SmartDialog.showToast("错误($code): ${result['msg']}"); - } } isQuerying = false; } diff --git a/lib/pages/video/view.dart b/lib/pages/video/view.dart index 25b8b082a..906e995d1 100644 --- a/lib/pages/video/view.dart +++ b/lib/pages/video/view.dart @@ -50,6 +50,7 @@ import 'package:PiliPlus/utils/num_util.dart'; import 'package:PiliPlus/utils/page_utils.dart'; import 'package:PiliPlus/utils/storage.dart'; import 'package:PiliPlus/utils/storage_key.dart'; +import 'package:PiliPlus/utils/storage_pref.dart'; import 'package:auto_orientation/auto_orientation.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:easy_debounce/easy_throttle.dart'; @@ -1553,10 +1554,12 @@ class _VideoDetailPageVState extends State .enableShowDanmaku .value = newVal; - GStorage.setting.put( - SettingBoxKey.enableShowDanmaku, - newVal, - ); + if (!Pref.tempPlayerConf) { + GStorage.setting.put( + SettingBoxKey.enableShowDanmaku, + newVal, + ); + } }, icon: Icon( size: 22, diff --git a/lib/pages/video/widgets/header_control.dart b/lib/pages/video/widgets/header_control.dart index 2516b317f..0784b7bd3 100644 --- a/lib/pages/video/widgets/header_control.dart +++ b/lib/pages/video/widgets/header_control.dart @@ -161,20 +161,20 @@ class HeaderControlState extends State { ), ListTile( dense: true, - onTap: () => { - Get.back(), - PageUtils.scheduleExit(this.context, isFullScreen), + onTap: () { + Get.back(); + PageUtils.scheduleExit(this.context, isFullScreen); }, leading: const Icon(Icons.hourglass_top_outlined, size: 20), title: const Text('定时关闭', style: titleStyle), ), ListTile( dense: true, - onTap: () => { - Get.back(), + onTap: () { + Get.back(); videoDetailCtr.queryVideoUrl( videoDetailCtr.playedTime, - ), + ); }, leading: const Icon(Icons.refresh_outlined, size: 20), title: const Text('重载视频', style: titleStyle), @@ -350,7 +350,10 @@ class HeaderControlState extends State { ), ListTile( dense: true, - onTap: () => {Get.back(), showSetVideoQa()}, + onTap: () { + Get.back(); + showSetVideoQa(); + }, leading: const Icon(Icons.play_circle_outline, size: 20), title: const Text('选择画质', style: titleStyle), subtitle: Text( @@ -361,7 +364,10 @@ class HeaderControlState extends State { if (videoDetailCtr.currentAudioQa != null) ListTile( dense: true, - onTap: () => {Get.back(), showSetAudioQa()}, + onTap: () { + Get.back(); + showSetAudioQa(); + }, leading: const Icon(Icons.album_outlined, size: 20), title: const Text('选择音质', style: titleStyle), subtitle: Text( @@ -371,7 +377,10 @@ class HeaderControlState extends State { ), ListTile( dense: true, - onTap: () => {Get.back(), showSetDecodeFormats()}, + onTap: () { + Get.back(); + showSetDecodeFormats(); + }, leading: const Icon(Icons.av_timer_outlined, size: 20), title: const Text('解码格式', style: titleStyle), subtitle: Text( @@ -381,7 +390,10 @@ class HeaderControlState extends State { ), ListTile( dense: true, - onTap: () => {Get.back(), showSetRepeat()}, + onTap: () { + Get.back(); + showSetRepeat(); + }, leading: const Icon(Icons.repeat, size: 20), title: const Text('播放顺序', style: titleStyle), subtitle: Text( @@ -391,20 +403,29 @@ class HeaderControlState extends State { ), ListTile( dense: true, - onTap: () => {Get.back(), showSetDanmaku()}, + onTap: () { + Get.back(); + showSetDanmaku(); + }, leading: const Icon(CustomIcon.dm_settings, size: 20), title: const Text('弹幕设置', style: titleStyle), ), ListTile( dense: true, - onTap: () => {Get.back(), showSetSubtitle()}, + onTap: () { + Get.back(); + showSetSubtitle(); + }, leading: const Icon(Icons.subtitles_outlined, size: 20), title: const Text('字幕设置', style: titleStyle), ), if (videoDetailCtr.subtitles.isNotEmpty) ListTile( dense: true, - onTap: () => {Get.back(), onExportSubtitle()}, + onTap: () { + Get.back(); + onExportSubtitle(); + }, leading: const Icon(Icons.download_outlined, size: 20), title: const Text('保存字幕', style: titleStyle), ), @@ -643,28 +664,22 @@ class HeaderControlState extends State { ..updatePlayer(); // update - late String oldQualityDesc; - await Connectivity().checkConnectivity().then((res) { + if (!Pref.tempPlayerConf) { + final res = await Connectivity().checkConnectivity(); if (res.contains(ConnectivityResult.wifi)) { - oldQualityDesc = VideoQuality.fromCode( - Pref.defaultVideoQa, - ).desc; setting.put( SettingBoxKey.defaultVideoQa, quality, ); } else { - oldQualityDesc = VideoQuality.fromCode( - Pref.defaultVideoQaCellular, - ).desc; setting.put( SettingBoxKey.defaultVideoQaCellular, quality, ); } - }); + } SmartDialog.showToast( - "默认画质由:$oldQualityDesc 变为:${VideoQuality.fromCode(quality).desc}", + "画质已变为:${VideoQuality.fromCode(quality).desc}", ); }, // 可能包含会员解锁画质 @@ -726,28 +741,22 @@ class HeaderControlState extends State { ..updatePlayer(); // update - late String oldQualityDesc; - await Connectivity().checkConnectivity().then((res) { + if (!Pref.tempPlayerConf) { + final res = await Connectivity().checkConnectivity(); if (res.contains(ConnectivityResult.wifi)) { - oldQualityDesc = AudioQuality.fromCode( - Pref.defaultAudioQa, - ).desc; setting.put( SettingBoxKey.defaultAudioQa, quality, ); } else { - oldQualityDesc = AudioQuality.fromCode( - Pref.defaultAudioQaCellular, - ).desc; setting.put( SettingBoxKey.defaultAudioQaCellular, quality, ); } - }); + } SmartDialog.showToast( - "默认音质由:$oldQualityDesc 变为:${AudioQuality.fromCode(quality).desc}", + "音质已变为:${AudioQuality.fromCode(quality).desc}", ); }, contentPadding: const EdgeInsets.only(left: 20, right: 20), @@ -1443,13 +1452,12 @@ class HeaderControlState extends State { minimumSize: Size.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap, ), - onPressed: () => { - Get.back(), - Get.toNamed( + onPressed: () => Get + ..back() + ..toNamed( '/danmakuBlock', arguments: widget.controller, ), - }, child: Text( "屏蔽管理(${plPlayerController.filters.count})", ), @@ -2094,7 +2102,9 @@ class HeaderControlState extends State { onPressed: () { final newVal = !enableShowDanmaku; plPlayerController.enableShowDanmaku.value = newVal; - setting.put(SettingBoxKey.enableShowDanmaku, newVal); + if (!Pref.tempPlayerConf) { + setting.put(SettingBoxKey.enableShowDanmaku, newVal); + } }, icon: Icon( enableShowDanmaku diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index fdaa7f48d..54350463c 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -656,7 +656,7 @@ class PlPlayerController { type ??= superResolutionType; } else { superResolutionType = type; - if (isAnim) { + if (isAnim && !Pref.tempPlayerConf) { GStorage.setting.put(SettingBoxKey.superResolutionType, type); } } @@ -1314,7 +1314,9 @@ class PlPlayerController { /// 设置后台播放 Future setBackgroundPlay(bool val) async { videoPlayerServiceHandler.enableBackgroundPlay = val; - setting.put(SettingBoxKey.enableBackgroundPlay, val); + if (!Pref.tempPlayerConf) { + setting.put(SettingBoxKey.enableBackgroundPlay, val); + } } set controls(bool visible) { @@ -1594,10 +1596,12 @@ class PlPlayerController { void setContinuePlayInBackground() { _continuePlayInBackground.value = !_continuePlayInBackground.value; - setting.put( - SettingBoxKey.continuePlayInBackground, - _continuePlayInBackground.value, - ); + if (!Pref.tempPlayerConf) { + setting.put( + SettingBoxKey.continuePlayInBackground, + _continuePlayInBackground.value, + ); + } } void setOnlyPlayAudio() { diff --git a/lib/utils/storage_key.dart b/lib/utils/storage_key.dart index f7195881a..2fb1da952 100644 --- a/lib/utils/storage_key.dart +++ b/lib/utils/storage_key.dart @@ -201,7 +201,8 @@ class SettingBoxKey { msgUnReadTypeV2 = 'msgUnReadTypeV2', hiddenSettingUnlocked = 'hiddenSettingUnlocked', enableGradientBg = 'enableGradientBg', - navBarSort = 'navBarSort'; + navBarSort = 'navBarSort', + tempPlayerConf = 'tempPlayerConf'; } class LocalCacheKey { diff --git a/lib/utils/storage_pref.dart b/lib/utils/storage_pref.dart index 0cadebd95..5bbfebd35 100644 --- a/lib/utils/storage_pref.dart +++ b/lib/utils/storage_pref.dart @@ -776,4 +776,7 @@ class Pref { _localCache.get(LocalCacheKey.historyPause, defaultValue: false); static int? get quickFavId => _setting.get(SettingBoxKey.quickFavId); + + static bool get tempPlayerConf => + _setting.get(SettingBoxKey.tempPlayerConf, defaultValue: false); }