refactor: GlobalDataCache
This commit is contained in:
@ -146,7 +146,7 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
||||
setKey: SettingBoxKey.enableSearchSuggest,
|
||||
defaultVal: true,
|
||||
callFn: (val) {
|
||||
GlobalDataCache().enableSearchSuggest = val;
|
||||
GlobalDataCache.enableSearchSuggest = val;
|
||||
},
|
||||
),
|
||||
SetSwitchItem(
|
||||
@ -181,7 +181,7 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
||||
setKey: SettingBoxKey.enableAutoExpand,
|
||||
defaultVal: false,
|
||||
callFn: (val) {
|
||||
GlobalDataCache().enableAutoExpand = val;
|
||||
GlobalDataCache.enableAutoExpand = val;
|
||||
},
|
||||
),
|
||||
const SetSwitchItem(
|
||||
|
||||
@ -38,7 +38,7 @@ class _ActionMenuSetPageState extends State<ActionMenuSetPage> {
|
||||
.map<String>((i) => (i['value'] as ActionType).value)
|
||||
.toList();
|
||||
setting.put(SettingBoxKey.actionTypeSort, sortedTabbar);
|
||||
GlobalDataCache().actionTypeSort = sortedTabbar;
|
||||
GlobalDataCache.actionTypeSort = sortedTabbar;
|
||||
SmartDialog.showToast('操作成功');
|
||||
}
|
||||
|
||||
|
||||
@ -58,11 +58,11 @@ class _PlayGesturePageState extends State<PlayGesturePage> {
|
||||
},
|
||||
);
|
||||
if (result != null) {
|
||||
GlobalDataCache().fullScreenGestureMode = FullScreenGestureMode
|
||||
GlobalDataCache.fullScreenGestureMode = FullScreenGestureMode
|
||||
.values
|
||||
.firstWhere((element) => element.values == result);
|
||||
fullScreenGestureMode =
|
||||
GlobalDataCache().fullScreenGestureMode.index;
|
||||
GlobalDataCache.fullScreenGestureMode.index;
|
||||
setting.put(
|
||||
SettingBoxKey.fullScreenGestureMode, fullScreenGestureMode);
|
||||
SmartDialog.showToast('设置成功');
|
||||
|
||||
@ -155,7 +155,7 @@ class _PlaySettingState extends State<PlaySetting> {
|
||||
setKey: SettingBoxKey.enablePlayerControlAnimation,
|
||||
defaultVal: true,
|
||||
callFn: (bool val) {
|
||||
GlobalDataCache().enablePlayerControlAnimation = val;
|
||||
GlobalDataCache.enablePlayerControlAnimation = val;
|
||||
}),
|
||||
SetSwitchItem(
|
||||
title: '港澳台模式',
|
||||
|
||||
@ -175,7 +175,7 @@ class _StyleSettingState extends State<StyleSetting> {
|
||||
SettingBoxKey.defaultPicQa, picQuality);
|
||||
Get.back();
|
||||
settingController.picQuality.value = picQuality;
|
||||
GlobalDataCache().imgQuality = picQuality;
|
||||
GlobalDataCache.imgQuality = picQuality;
|
||||
SmartDialog.showToast('设置成功');
|
||||
},
|
||||
child: const Text('确定'),
|
||||
|
||||
Reference in New Issue
Block a user