mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-28 22:40:13 +08:00
opt: settings (#977)
This commit is contained in:
committed by
GitHub
parent
aaad7fc6dc
commit
34c5d6812f
@@ -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<LiveRoomPage>
|
||||
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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -119,52 +119,52 @@ List<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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,
|
||||
),
|
||||
|
||||
@@ -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<bool>? 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<bool>? 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,
|
||||
|
||||
@@ -19,11 +19,11 @@ import 'package:get/get.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
|
||||
List<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> get playSettings => [
|
||||
videoPlayerServiceHandler.enableBackgroundPlay = value;
|
||||
},
|
||||
),
|
||||
const SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
title: '播放器设置仅对当前生效',
|
||||
subtitle: '弹幕、字幕及部分设置中没有的设置除外',
|
||||
leading: Icon(Icons.video_settings_outlined),
|
||||
setKey: SettingBoxKey.tempPlayerConf,
|
||||
defaultVal: false,
|
||||
),
|
||||
];
|
||||
|
||||
@@ -9,20 +9,20 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
List<SettingsModel> 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,
|
||||
),
|
||||
|
||||
@@ -47,11 +47,11 @@ List<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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,
|
||||
|
||||
@@ -17,19 +17,19 @@ import 'package:get/get.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
|
||||
List<SettingsModel> 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<SettingsModel> 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<SettingsModel> 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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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<bool>? 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<NormalItem> createState() => _NormalItemState();
|
||||
@@ -45,12 +47,12 @@ class _NormalItemState extends State<NormalItem> {
|
||||
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,
|
||||
),
|
||||
|
||||
@@ -27,10 +27,11 @@ class SelectDialog<T> 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<T> 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<CdnSelectDialog> {
|
||||
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<void> _startSpeedTest() async {
|
||||
|
||||
@@ -40,7 +40,7 @@ class _SettingsSearchPageState extends SearchState<SettingsSearchPage> {
|
||||
_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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<VideoDetailPageV>
|
||||
.enableShowDanmaku
|
||||
.value =
|
||||
newVal;
|
||||
GStorage.setting.put(
|
||||
SettingBoxKey.enableShowDanmaku,
|
||||
newVal,
|
||||
);
|
||||
if (!Pref.tempPlayerConf) {
|
||||
GStorage.setting.put(
|
||||
SettingBoxKey.enableShowDanmaku,
|
||||
newVal,
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: Icon(
|
||||
size: 22,
|
||||
|
||||
@@ -161,20 +161,20 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
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<HeaderControl> {
|
||||
),
|
||||
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<HeaderControl> {
|
||||
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<HeaderControl> {
|
||||
),
|
||||
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<HeaderControl> {
|
||||
),
|
||||
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<HeaderControl> {
|
||||
),
|
||||
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<HeaderControl> {
|
||||
..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<HeaderControl> {
|
||||
..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<HeaderControl> {
|
||||
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<HeaderControl> {
|
||||
onPressed: () {
|
||||
final newVal = !enableShowDanmaku;
|
||||
plPlayerController.enableShowDanmaku.value = newVal;
|
||||
setting.put(SettingBoxKey.enableShowDanmaku, newVal);
|
||||
if (!Pref.tempPlayerConf) {
|
||||
setting.put(SettingBoxKey.enableShowDanmaku, newVal);
|
||||
}
|
||||
},
|
||||
icon: Icon(
|
||||
enableShowDanmaku
|
||||
|
||||
Reference in New Issue
Block a user