mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
fix: SetSwitchItem
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -36,6 +36,15 @@ class SetSwitchItem extends StatefulWidget {
|
|||||||
class _SetSwitchItemState extends State<SetSwitchItem> {
|
class _SetSwitchItemState extends State<SetSwitchItem> {
|
||||||
late bool val;
|
late bool val;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didUpdateWidget(SetSwitchItem oldWidget) {
|
||||||
|
super.didUpdateWidget(oldWidget);
|
||||||
|
if (oldWidget.setKey != widget.setKey) {
|
||||||
|
val = GStorage.setting
|
||||||
|
.get(widget.setKey, defaultValue: widget.defaultVal ?? false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|||||||
Reference in New Issue
Block a user