mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: add check update
Closes #112 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -29,6 +29,7 @@ import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/recommend_filter.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:auto_orientation/auto_orientation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -1886,4 +1887,17 @@ List<SettingsModel> get extraSettings => [
|
||||
setKey: SettingBoxKey.autoClearCache,
|
||||
defaultVal: false,
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
title: '检查更新',
|
||||
subtitle: '每次启动时检查是否需要更新',
|
||||
leading: const Icon(Icons.system_update_alt_outlined),
|
||||
setKey: SettingBoxKey.autoUpdate,
|
||||
defaultVal: true,
|
||||
onChanged: (val) {
|
||||
if (val) {
|
||||
Utils.checkUpdate();
|
||||
}
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
@@ -84,9 +84,6 @@ class _SetSwitchItemState extends State<SetSwitchItem> {
|
||||
val = value ?? !val;
|
||||
|
||||
await GStorage.setting.put(widget.setKey, val);
|
||||
// if (widget.setKey == SettingBoxKey.autoUpdate && value == true) {
|
||||
// Utils.checkUpdate();
|
||||
// }
|
||||
widget.onChanged?.call(val);
|
||||
if (widget.needReboot == true) {
|
||||
SmartDialog.showToast('重启生效');
|
||||
|
||||
Reference in New Issue
Block a user