Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

remove unused file

ErBW_s13cfed6f13ca
diff --git a/lib/bean/settings/settings.dart b/lib/bean/settings/settings.dart
deleted file mode 100644
index e85f5f71..00000000
--- a/lib/bean/settings/settings.dart
+++ /dev/null
@@ -1,142 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:hive/hive.dart';
-import 'package:kazumi/bean/dialog/dialog_helper.dart';
-import 'package:kazumi/utils/storage.dart';
-
-class SetSwitchItem extends StatefulWidget {
- final String? title;
- final String? subTitle;
- final String? setKey;
- final bool? defaultVal;
- final Function? callFn;
- final bool? needReboot;
-
- const SetSwitchItem({
- this.title,
- this.subTitle,
- this.setKey,
- this.defaultVal,
- this.callFn,
- this.needReboot,
- super.key,
- });
-
- @override
- State<SetSwitchItem> createState() => _SetSwitchItemState();
-}
-
-class _SetSwitchItemState extends State<SetSwitchItem> {
- // ignore: non_constant_identifier_names
- Box Setting = GStorage.setting;
- late bool val;
-
- @override
- void initState() {
- super.initState();
- val = Setting.get(widget.setKey, defaultValue: widget.defaultVal ?? false);
- }
-
- void switchChange(value) async {
- val = value ?? !val;
- await Setting.put(widget.setKey, val);
- widget.callFn?.call(val);
- if (widget.needReboot != null && widget.needReboot!) {
- KazumiDialog.showToast(message: '重启生效');
- }
- setState(() {});
- }
-
- @override
- Widget build(BuildContext context) {
- TextStyle titleStyle = Theme.of(context).textTheme.titleMedium!;
- TextStyle subTitleStyle = Theme.of(context)
- .textTheme
- .labelMedium!
- .copyWith(color: Theme.of(context).colorScheme.outline);
- return ListTile(
- enableFeedback: true,
- onTap: () => switchChange(null),
- title: Text(widget.title!, style: titleStyle),
- subtitle: widget.subTitle != null
- ? Text(widget.subTitle!, style: subTitleStyle)
- : null,
- trailing: Transform.scale(
- alignment: Alignment.centerRight, // 缩放Switch的大小后保持右侧对齐, 避免右侧空隙过大
- scale: 0.8,
- child: Switch(
- value: val,
- onChanged: (val) => switchChange(val),
- ),
- ),
- );
- }
-}
-
-class SelectDialog<T> extends StatefulWidget {
- final T value;
- final String title;
- final List<dynamic> values;
- const SelectDialog(
- {super.key,
- required this.value,
- required this.values,
- required this.title});
-
- @override
- State<SelectDialog<T>> createState() => _SelectDialogState<T>();
-}
-
-class _SelectDialogState<T> extends State<SelectDialog<T>> {
- late T _tempValue;
-
- @override
- void initState() {
- super.initState();
- _tempValue = widget.value;
- }
-
- @override
- Widget build(BuildContext context) {
- TextStyle titleStyle = Theme.of(context).textTheme.titleMedium!;
-
- return AlertDialog(
- title: Text(widget.title),
- contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 12),
- content: StatefulBuilder(builder: (context, StateSetter setState) {
- return SingleChildScrollView(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- for (var i in widget.values) ...[
- RadioListTile(
- value: i['value'],
- title: Text(i['title'], style: titleStyle),
- groupValue: _tempValue,
- onChanged: (value) {
- setState(() {
- _tempValue = value as T;
- });
- },
- ),
- ]
- ],
- ),
- );
- }),
- actions: [
- TextButton(
- onPressed: () => Navigator.pop(context),
- child: Text(
- '取消',
- style: TextStyle(color: Theme.of(context).colorScheme.outline),
- ),
- ),
- TextButton(
- onPressed: () => Navigator.pop(context, _tempValue),
- child: const Text('确定'),
- )
- ],
- );
- }
-}
-
diff --git a/lib/pages/settings/danmaku/danmaku_module.dart b/lib/pages/settings/danmaku/danmaku_module.dart
index 5f9c67de..75d6e0dc 100644
--- a/lib/pages/settings/danmaku/danmaku_module.dart
+++ b/lib/pages/settings/danmaku/danmaku_module.dart
@@ -1,5 +1,4 @@
import 'package:kazumi/pages/settings/danmaku/danmaku_settings.dart';
-import 'package:kazumi/pages/settings/danmaku/danmaku_source_settings.dart';
import 'package:flutter_modular/flutter_modular.dart';
class DanmakuModule extends Module {
diff --git a/lib/pages/settings/danmaku/danmaku_source_settings.dart b/lib/pages/settings/danmaku/danmaku_source_settings.dart
deleted file mode 100644
index 34bd6bff..00000000
--- a/lib/pages/settings/danmaku/danmaku_source_settings.dart
+++ /dev/null
@@ -1,52 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:kazumi/bean/settings/settings.dart';
-import 'package:kazumi/utils/storage.dart';
-import 'package:hive/hive.dart';
-import 'package:kazumi/bean/appbar/sys_app_bar.dart';
-
-class DanmakuSourceSettingsPage extends StatefulWidget {
- const DanmakuSourceSettingsPage({super.key});
-
- @override
- State<DanmakuSourceSettingsPage> createState() =>
- _DanmakuSourceSettingsPageState();
-}
-
-class _DanmakuSourceSettingsPageState extends State<DanmakuSourceSettingsPage> {
- Box setting = GStorage.setting;
-
- @override
- Widget build(BuildContext context) {
- return PopScope(
- canPop: true,
- child: Scaffold(
- appBar: const SysAppBar(title: Text('弹幕来源')),
- body: ListView(
- children: const [
- InkWell(
- child: SetSwitchItem(
- title: 'BiliBili',
- setKey: SettingBoxKey.danmakuBiliBiliSource,
- defaultVal: true,
- ),
- ),
- InkWell(
- child: SetSwitchItem(
- title: 'Gamer',
- setKey: SettingBoxKey.danmakuGamerSource,
- defaultVal: true,
- ),
- ),
- InkWell(
- child: SetSwitchItem(
- title: 'DanDan',
- setKey: SettingBoxKey.danmakuDanDanSource,
- defaultVal: true,
- ),
- ),
- ],
- ),
- ),
- );
- }
-}
diff --git a/lib/pages/settings/other_settings.dart b/lib/pages/settings/other_settings.dart
deleted file mode 100644
index 87b01af1..00000000
--- a/lib/pages/settings/other_settings.dart
+++ /dev/null
@@ -1,69 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:kazumi/bean/settings/settings.dart';
-import 'package:kazumi/utils/storage.dart';
-import 'package:hive/hive.dart';
-import 'package:kazumi/bean/appbar/sys_app_bar.dart';
-
-class OtherSettingsPage extends StatefulWidget {
- const OtherSettingsPage({super.key});
-
- @override
- State<OtherSettingsPage> createState() => _OtherSettingsPageState();
-}
-
-class _OtherSettingsPageState extends State<OtherSettingsPage> {
- Box setting = GStorage.setting;
- late dynamic enableGitProxy;
-
- @override
- void initState() {
- super.initState();
- enableGitProxy =
- setting.get(SettingBoxKey.enableGitProxy, defaultValue: false);
- }
-
- void onBackPressed(BuildContext context) {
- // Navigator.of(context).pop();
- }
-
- @override
- Widget build(BuildContext context) {
- WidgetsBinding.instance.addPostFrameCallback((_) {});
- return PopScope(
- canPop: true,
- onPopInvokedWithResult: (bool didPop, Object? result) {
- onBackPressed(context);
- },
- child: const Scaffold(
- appBar: SysAppBar(title: Text('其他设置')),
- body: Column(
- children: [
- InkWell(
- child: SetSwitchItem(
- title: 'Github镜像',
- subTitle: '使用镜像访问规则托管仓库',
- setKey: SettingBoxKey.enableGitProxy,
- defaultVal: false,
- ),
- ),
- InkWell(
- child: SetSwitchItem(
- title: '隐身模式',
- subTitle: '不保留观看记录',
- setKey: SettingBoxKey.privateMode,
- defaultVal: false,
- ),
- ),
- InkWell(
- child: SetSwitchItem(
- title: '自动更新',
- setKey: SettingBoxKey.autoUpdate,
- defaultVal: true,
- ),
- ),
- ],
- ),
- ),
- );
- }
-}
diff --git a/lib/pages/settings/settings_module.dart b/lib/pages/settings/settings_module.dart
index d8df2ff7..664093c2 100644
--- a/lib/pages/settings/settings_module.dart
+++ b/lib/pages/settings/settings_module.dart
@@ -6,7 +6,6 @@ import 'package:kazumi/pages/history/history_module.dart';
import 'package:kazumi/pages/settings/theme_settings_page.dart';
import 'package:kazumi/pages/settings/player_settings.dart';
import 'package:kazumi/pages/settings/displaymode_settings.dart';
-import 'package:kazumi/pages/settings/other_settings.dart';
import 'package:kazumi/pages/webdav_editor/webdav_module.dart';
class SettingsModule extends Module {