feat: 首页顶栏&底栏固定 issues #243

This commit is contained in:
guozhigq
2023-12-02 22:41:24 +08:00
parent 7ed91a72c6
commit 6ebfe5872e
11 changed files with 70 additions and 11 deletions

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:hive/hive.dart';
import 'package:pilipala/utils/storage.dart';
import 'package:pilipala/utils/utils.dart';
@ -9,6 +10,7 @@ class SetSwitchItem extends StatefulWidget {
final String? setKey;
final bool? defaultVal;
final Function? callFn;
final bool? needReboot;
const SetSwitchItem({
this.title,
@ -16,6 +18,7 @@ class SetSwitchItem extends StatefulWidget {
this.setKey,
this.defaultVal,
this.callFn,
this.needReboot,
Key? key,
}) : super(key: key);
@ -43,6 +46,9 @@ class _SetSwitchItemState extends State<SetSwitchItem> {
if (widget.callFn != null) {
widget.callFn!.call(val);
}
if (widget.needReboot != null && widget.needReboot!) {
SmartDialog.showToast('重启生效');
}
setState(() {});
}