Skip to content

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

chore: remove update settings page

Predidit094d053af977
diff --git a/lib/pages/about/about_page.dart b/lib/pages/about/about_page.dart
index c420758c..06065a33 100644
--- a/lib/pages/about/about_page.dart
+++ b/lib/pages/about/about_page.dart
@@ -256,13 +256,6 @@ class _AboutPageState extends State<AboutPage> {
title: const Text('自动更新'),
initialValue: autoUpdate,
),
- SettingsTile.navigation(
- onPressed: (_) {
- Modular.to.pushNamed('/settings/update');
- },
- title: const Text('更新设置'),
- description: const Text('检查更新、下载安装新版本'),
- ),
SettingsTile.navigation(
onPressed: (_) {
myController.checkUpdate();
diff --git a/lib/pages/settings/settings_module.dart b/lib/pages/settings/settings_module.dart
index 0d192f46..80f60fec 100644
--- a/lib/pages/settings/settings_module.dart
+++ b/lib/pages/settings/settings_module.dart
@@ -8,7 +8,6 @@ import 'package:kazumi/pages/settings/player_settings.dart';
import 'package:kazumi/pages/settings/displaymode_settings.dart';
import 'package:kazumi/pages/settings/decoder_settings.dart';
import 'package:kazumi/pages/settings/super_resolution_settings.dart';
-import 'package:kazumi/pages/settings/update_page.dart';
import 'package:kazumi/pages/webdav_editor/webdav_module.dart';
class SettingsModule extends Module {
@@ -23,7 +22,6 @@ class SettingsModule extends Module {
r.child("/player/decoder", child: (_) => const DecoderSettings());
// r.child("/other", child: (_) => const OtherSettingsPage());
r.child("/player/super", child: (_) => const SuperResolutionSettings());
- r.child("/update", child: (_) => const UpdatePage());
r.module("/webdav", module: WebDavModule());
r.module("/about", module: AboutModule());
r.module("/plugin", module: PluginModule());
diff --git a/lib/pages/settings/update_page.dart b/lib/pages/settings/update_page.dart
deleted file mode 100644
index 8ae4eea9..00000000
--- a/lib/pages/settings/update_page.dart
+++ /dev/null
@@ -1,147 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:kazumi/bean/appbar/sys_app_bar.dart';
-import 'package:kazumi/bean/dialog/dialog_helper.dart';
-import 'package:kazumi/request/api.dart';
-import 'package:kazumi/utils/auto_updater.dart';
-import 'package:kazumi/utils/storage.dart';
-import 'package:hive/hive.dart';
-import 'package:card_settings_ui/card_settings_ui.dart';
-
-class UpdatePage extends StatefulWidget {
- const UpdatePage({super.key});
-
- @override
- State<UpdatePage> createState() => _UpdatePageState();
-}
-
-class _UpdatePageState extends State<UpdatePage> {
- Box setting = GStorage.setting;
- late bool autoUpdate;
- bool isChecking = false;
- UpdateInfo? latestUpdate;
-
- @override
- void initState() {
- super.initState();
- autoUpdate = setting.get(SettingBoxKey.autoUpdate, defaultValue: true);
- _checkForUpdates();
- }
-
- Future<void> _checkForUpdates() async {
- if (isChecking) return;
-
- setState(() {
- isChecking = true;
- });
-
- try {
- final autoUpdater = AutoUpdater();
- final updateInfo = await autoUpdater.checkForUpdates();
-
- setState(() {
- latestUpdate = updateInfo;
- isChecking = false;
- });
- } catch (e) {
- setState(() {
- isChecking = false;
- });
- KazumiDialog.showToast(message: '检查更新失败');
- }
- }
-
- void _manualCheckUpdate() async {
- final autoUpdater = AutoUpdater();
- await autoUpdater.manualCheckForUpdates();
- // 检查完成后刷新状态
- _checkForUpdates();
- }
-
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: const SysAppBar(title: Text('应用更新')),
- body: Center(
- child: SizedBox(
- width: (MediaQuery.of(context).size.width > 1000) ? 1000 : null,
- child: SettingsList(
- sections: [
- SettingsSection(
- title: const Text('当前版本'),
- tiles: [
- SettingsTile.navigation(
- title: const Text('版本号'),
- value: Text(Api.version),
- leading: const Icon(Icons.info_outline),
- onPressed: null,
- ),
- SettingsTile.navigation(
- title: const Text('更新状态'),
- value: _buildUpdateStatusWidget(),
- leading: const Icon(Icons.update),
- onPressed: null,
- ),
- ],
- ),
- SettingsSection(
- title: const Text('更新设置'),
- tiles: [
- SettingsTile.navigation(
- onPressed: (_) => _manualCheckUpdate(),
- title: const Text('检查更新'),
- description: const Text('立即检查是否有新版本'),
- leading: const Icon(Icons.refresh),
- trailing: isChecking
- ? const SizedBox(
- width: 16,
- height: 16,
- child: CircularProgressIndicator(strokeWidth: 2),
- )
- : SizedBox.shrink(),
- ),
- ],
- ),
- if (latestUpdate != null) ...[
- SettingsSection(
- title: const Text('可用更新'),
- tiles: [
- SettingsTile.navigation(
- title: Text('新版本 ${latestUpdate!.version}'),
- leading: const Icon(Icons.system_update),
- onPressed: (_) {
- _manualCheckUpdate();
- },
- ),
- ],
- ),
- ],
- ],
- ),
- ),
- ),
- );
- }
-
- Widget _buildUpdateStatusWidget() {
- if (isChecking) {
- return const Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- SizedBox(
- width: 12,
- height: 12,
- child: CircularProgressIndicator(strokeWidth: 2),
- ),
- SizedBox(width: 8),
- Text('检查中...'),
- ],
- );
- }
-
- if (latestUpdate != null) {
- return const Text('有新版本可用');
- }
-
- return const Text('已是最新版本');
- }
-}
diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift
index a3ad66b1..864a03ad 100644
--- a/macos/Flutter/GeneratedPluginRegistrant.swift
+++ b/macos/Flutter/GeneratedPluginRegistrant.swift
@@ -16,6 +16,7 @@ import package_info_plus
import path_provider_foundation
import screen_pixel
import screen_retriever_macos
+import shared_preferences_foundation
import sqflite_darwin
import tray_manager
import url_launcher_macos
@@ -35,6 +36,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
ScreenPixelPlugin.register(with: registry.registrar(forPlugin: "ScreenPixelPlugin"))
ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin"))
+ SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
TrayManagerPlugin.register(with: registry.registrar(forPlugin: "TrayManagerPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
diff --git a/pubspec.lock b/pubspec.lock
index c3c59ab2..8aa2b8a9 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -939,6 +939,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
+ open_filex:
+ dependency: "direct main"
+ description:
+ name: open_filex
+ sha256: "9976da61b6a72302cf3b1efbce259200cd40232643a467aac7370addf94d6900"
+ url: "https://pub.dev"
+ source: hosted
+ version: "4.7.0"
+ os_detect:
+ dependency: transitive
+ description:
+ name: os_detect
+ sha256: "7d87c0dd98c6faf110d5aa498e9a6df02ffce4bb78cc9cfc8ad02929be9bb71f"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.0.3"
package_config:
dependency: transitive
description:
@@ -1211,6 +1227,62 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.26.1"
+ shared_preferences:
+ dependency: transitive
+ description:
+ name: shared_preferences
+ sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.5.3"
+ shared_preferences_android:
+ dependency: transitive
+ description:
+ name: shared_preferences_android
+ sha256: "5bcf0772a761b04f8c6bf814721713de6f3e5d9d89caf8d3fe031b02a342379e"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.4.11"
+ shared_preferences_foundation:
+ dependency: transitive
+ description:
+ name: shared_preferences_foundation
+ sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.5.4"
+ shared_preferences_linux:
+ dependency: transitive
+ description:
+ name: shared_preferences_linux
+ sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.4.1"
+ shared_preferences_platform_interface:
+ dependency: transitive
+ description:
+ name: shared_preferences_platform_interface
+ sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.4.1"
+ shared_preferences_web:
+ dependency: transitive
+ description:
+ name: shared_preferences_web
+ sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.4.3"
+ shared_preferences_windows:
+ dependency: transitive
+ description:
+ name: shared_preferences_windows
+ sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1"
+ url: "https://pub.dev"
+ source: hosted
+ version: "2.4.1"
shelf:
dependency: transitive
description:
@@ -1416,6 +1488,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.0"
+ upgrader:
+ dependency: "direct main"
+ description:
+ name: upgrader
+ sha256: "60293b391f4146ce1e381ed6198b6374559a4aadf885d313e94e6c7d454d03ca"
+ url: "https://pub.dev"
+ source: hosted
+ version: "11.4.0"
uri_parser:
dependency: transitive
description:
@@ -1528,6 +1608,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
+ version:
+ dependency: transitive
+ description:
+ name: version
+ sha256: "3d4140128e6ea10d83da32fef2fa4003fccbf6852217bb854845802f04191f94"
+ url: "https://pub.dev"
+ source: hosted
+ version: "3.0.2"
vm_service:
dependency: transitive
description: