feat: pgc skip

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-08 21:22:02 +08:00
parent 06d8296939
commit ca0eb1716f
13 changed files with 232 additions and 94 deletions

View File

@@ -13,6 +13,7 @@ import 'package:PiliPlus/models/common/dynamic/dynamics_type.dart';
import 'package:PiliPlus/models/common/member/tab_type.dart';
import 'package:PiliPlus/models/common/reply/reply_sort_type.dart';
import 'package:PiliPlus/models/common/settings_type.dart';
import 'package:PiliPlus/models/common/sponsor_block/skip_type.dart';
import 'package:PiliPlus/models/common/super_resolution_type.dart';
import 'package:PiliPlus/models/dynamics/result.dart';
import 'package:PiliPlus/pages/common/slide/common_slide_page.dart';
@@ -71,6 +72,54 @@ List<SettingsModel> get extraSettings => [
],
),
),
SettingsModel(
settingsType: SettingsType.normal,
leading: const Icon(MdiIcons.debugStepOver),
title: '番剧片头/片尾跳过类型',
getTrailing: () => Builder(
builder: (context) {
final pgcSkipType = Pref.pgcSkipType;
final colorScheme = ColorScheme.of(context);
final color = pgcSkipType == SkipType.disable
? colorScheme.outline
: colorScheme.secondary;
return PopupMenuButton<SkipType>(
initialValue: pgcSkipType,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
pgcSkipType.title,
style: TextStyle(fontSize: 14, height: 1, color: color),
strutStyle: const StrutStyle(
leading: 0,
height: 1,
fontSize: 14,
),
),
Icon(
MdiIcons.unfoldMoreHorizontal,
size: MediaQuery.textScalerOf(context).scale(14),
color: color,
),
],
),
),
onSelected: (value) async {
await GStorage.setting.put(SettingBoxKey.pgcSkipType, value.index);
if (context.mounted) {
(context as Element).markNeedsBuild();
}
},
itemBuilder: (context) => SkipType.values
.map((e) => PopupMenuItem(value: e, child: Text(e.title)))
.toList(),
);
},
),
),
SettingsModel(
settingsType: SettingsType.sw1tch,
title: '检查未读动态',
@@ -185,6 +234,14 @@ List<SettingsModel> get extraSettings => [
setKey: SettingBoxKey.horizontalMemberPage,
defaultVal: false,
),
SettingsModel(
settingsType: SettingsType.sw1tch,
title: '横屏在侧栏打开图片预览',
leading: const Icon(Icons.photo_outlined),
setKey: SettingBoxKey.horizontalPreview,
defaultVal: false,
onChanged: (value) => CustomGridView.horizontalPreview = value,
),
SettingsModel(
settingsType: SettingsType.normal,
title: '评论折叠行数',
@@ -331,14 +388,6 @@ List<SettingsModel> get extraSettings => [
setKey: SettingBoxKey.continuePlayingPart,
defaultVal: true,
),
SettingsModel(
settingsType: SettingsType.sw1tch,
title: '横屏在侧栏打开图片预览',
leading: const Icon(Icons.photo_outlined),
setKey: SettingBoxKey.horizontalPreview,
defaultVal: false,
onChanged: (value) => CustomGridView.horizontalPreview = value,
),
getBanwordModel(
context: Get.context!,
title: '评论关键词过滤',