mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-14 21:24:02 +08:00
@@ -2,7 +2,6 @@ import 'package:PiliPlus/common/widgets/dialog/dialog.dart';
|
||||
import 'package:PiliPlus/common/widgets/flutter/list_tile.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' hide ListTile;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
@@ -42,14 +41,10 @@ class _SetSwitchItemState extends State<SetSwitchItem> {
|
||||
late bool val;
|
||||
|
||||
void setVal() {
|
||||
if (widget.setKey == SettingBoxKey.appFontWeight) {
|
||||
val = Pref.appFontWeight != -1;
|
||||
} else {
|
||||
val = GStorage.setting.get(
|
||||
widget.setKey,
|
||||
defaultValue: widget.defaultVal,
|
||||
);
|
||||
}
|
||||
val = GStorage.setting.get(
|
||||
widget.setKey,
|
||||
defaultValue: widget.defaultVal,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -77,11 +72,7 @@ class _SetSwitchItemState extends State<SetSwitchItem> {
|
||||
);
|
||||
}
|
||||
|
||||
if (widget.setKey == SettingBoxKey.appFontWeight) {
|
||||
await GStorage.setting.put(SettingBoxKey.appFontWeight, val ? 4 : -1);
|
||||
} else {
|
||||
await GStorage.setting.put(widget.setKey, val);
|
||||
}
|
||||
await GStorage.setting.put(widget.setKey, val);
|
||||
|
||||
widget.onChanged?.call(val);
|
||||
if (widget.needReboot) {
|
||||
|
||||
Reference in New Issue
Block a user