mod: 取消iOS路由效果
This commit is contained in:
@ -20,7 +20,8 @@ class StyleSetting extends StatefulWidget {
|
|||||||
|
|
||||||
class _StyleSettingState extends State<StyleSetting> {
|
class _StyleSettingState extends State<StyleSetting> {
|
||||||
final SettingController settingController = Get.put(SettingController());
|
final SettingController settingController = Get.put(SettingController());
|
||||||
final ColorSelectController colorSelectController = Get.put(ColorSelectController());
|
final ColorSelectController colorSelectController =
|
||||||
|
Get.put(ColorSelectController());
|
||||||
|
|
||||||
Box setting = GStrorage.setting;
|
Box setting = GStrorage.setting;
|
||||||
late int picQuality;
|
late int picQuality;
|
||||||
@ -76,12 +77,6 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SetSwitchItem(
|
|
||||||
title: 'iOS路由切换',
|
|
||||||
subTitle: 'iOS路由切换样式,需重启',
|
|
||||||
setKey: SettingBoxKey.iosTransition,
|
|
||||||
defaultVal: false,
|
|
||||||
),
|
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
title: 'MD3样式底栏',
|
title: 'MD3样式底栏',
|
||||||
subTitle: '符合Material You设计规范的底栏',
|
subTitle: '符合Material You设计规范的底栏',
|
||||||
@ -107,9 +102,12 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
int? result = await showDialog(
|
int? result = await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return SelectDialog<int>(title: '自定义列数', value: defaultCustomRows, values: [1, 2, 3, 4, 5].map((e) {
|
return SelectDialog<int>(
|
||||||
return {'title': '$e 列', 'value': e};
|
title: '自定义列数',
|
||||||
}).toList());
|
value: defaultCustomRows,
|
||||||
|
values: [1, 2, 3, 4, 5].map((e) {
|
||||||
|
return {'title': '$e 列', 'value': e};
|
||||||
|
}).toList());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
@ -195,16 +193,18 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
ThemeType? result = await showDialog(
|
ThemeType? result = await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return SelectDialog<ThemeType>(title: '主题模式', value: _tempThemeValue, values: ThemeType.values.map((e) {
|
return SelectDialog<ThemeType>(
|
||||||
return {'title': e.description, 'value': e};
|
title: '主题模式',
|
||||||
}).toList());
|
value: _tempThemeValue,
|
||||||
|
values: ThemeType.values.map((e) {
|
||||||
|
return {'title': e.description, 'value': e};
|
||||||
|
}).toList());
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
_tempThemeValue = result;
|
_tempThemeValue = result;
|
||||||
settingController.themeType.value = result;
|
settingController.themeType.value = result;
|
||||||
setting.put(
|
setting.put(SettingBoxKey.themeMode, result.code);
|
||||||
SettingBoxKey.themeMode, result.code);
|
|
||||||
Get.forceAppUpdate();
|
Get.forceAppUpdate();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -218,7 +218,7 @@ class _StyleSettingState extends State<StyleSetting> {
|
|||||||
onTap: () => Get.toNamed('/colorSetting'),
|
onTap: () => Get.toNamed('/colorSetting'),
|
||||||
title: Text('应用主题', style: titleStyle),
|
title: Text('应用主题', style: titleStyle),
|
||||||
subtitle: Obx(() => Text(
|
subtitle: Obx(() => Text(
|
||||||
'当前主题:${colorSelectController.type.value == 0 ? '动态取色': '指定颜色'}',
|
'当前主题:${colorSelectController.type.value == 0 ? '动态取色' : '指定颜色'}',
|
||||||
style: subTitleStyle)),
|
style: subTitleStyle)),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
|
@ -47,8 +47,6 @@ import 'package:pilipala/pages/whisperDetail/index.dart';
|
|||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
Box setting = GStrorage.setting;
|
Box setting = GStrorage.setting;
|
||||||
bool iosTransition =
|
|
||||||
setting.get(SettingBoxKey.iosTransition, defaultValue: false);
|
|
||||||
|
|
||||||
class Routes {
|
class Routes {
|
||||||
static final List<GetPage> getPages = [
|
static final List<GetPage> getPages = [
|
||||||
@ -164,7 +162,7 @@ class CustomGetPage extends GetPage {
|
|||||||
name: name,
|
name: name,
|
||||||
page: page,
|
page: page,
|
||||||
curve: Curves.linear,
|
curve: Curves.linear,
|
||||||
transition: iosTransition ? Transition.cupertino : Transition.native,
|
transition: Transition.native,
|
||||||
showCupertinoParallax: false,
|
showCupertinoParallax: false,
|
||||||
popGesture: false,
|
popGesture: false,
|
||||||
transitionDuration: transitionDuration,
|
transitionDuration: transitionDuration,
|
||||||
|
@ -135,7 +135,6 @@ class SettingBoxKey {
|
|||||||
static const String defaultTextScale = 'textScale';
|
static const String defaultTextScale = 'textScale';
|
||||||
static const String dynamicColor = 'dynamicColor'; // bool
|
static const String dynamicColor = 'dynamicColor'; // bool
|
||||||
static const String customColor = 'customColor'; // 自定义主题色
|
static const String customColor = 'customColor'; // 自定义主题色
|
||||||
static const String iosTransition = 'iosTransition'; // ios路由
|
|
||||||
static const String enableSingleRow = 'enableSingleRow'; // 首页单列
|
static const String enableSingleRow = 'enableSingleRow'; // 首页单列
|
||||||
static const String displayMode = 'displayMode';
|
static const String displayMode = 'displayMode';
|
||||||
static const String customRows = 'customRows'; // 自定义列
|
static const String customRows = 'customRows'; // 自定义列
|
||||||
|
Reference in New Issue
Block a user