feat: 首页顶栏&底栏固定 issues #243
This commit is contained in:
@ -83,13 +83,20 @@ class _StyleSettingState extends State<StyleSetting> {
|
||||
setKey: SettingBoxKey.enableMYBar,
|
||||
defaultVal: true,
|
||||
),
|
||||
// SetSwitchItem(
|
||||
// title: '首页单列',
|
||||
// subTitle: '每行展示一个内容卡片',
|
||||
// setKey: SettingBoxKey.enableSingleRow,
|
||||
// defaultVal: false,
|
||||
// callFn: (val) => {SmartDialog.showToast('下次启动时生效')},
|
||||
// ),
|
||||
const SetSwitchItem(
|
||||
title: '首页顶栏收起',
|
||||
subTitle: '首页列表滑动时,收起顶栏',
|
||||
setKey: SettingBoxKey.hideSearchBar,
|
||||
defaultVal: true,
|
||||
needReboot: true,
|
||||
),
|
||||
const SetSwitchItem(
|
||||
title: '首页底栏收起',
|
||||
subTitle: '首页列表滑动时,收起底栏',
|
||||
setKey: SettingBoxKey.hideTabBar,
|
||||
defaultVal: true,
|
||||
needReboot: true,
|
||||
),
|
||||
ListTile(
|
||||
dense: false,
|
||||
title: Text('自定义列数', style: titleStyle),
|
||||
|
||||
@ -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(() {});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user