opt: 数据初始化

This commit is contained in:
guozhigq
2024-08-26 23:23:43 +08:00
parent f0cd9c5cf2
commit 2e329553d9
13 changed files with 137 additions and 99 deletions

View File

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:hive/hive.dart';
import 'package:pilipala/models/common/action_type.dart';
import 'package:pilipala/utils/global_data.dart';
import 'package:pilipala/utils/global_data_cache.dart';
import '../../../utils/storage.dart';
class ActionMenuSetPage extends StatefulWidget {
@ -38,7 +38,7 @@ class _ActionMenuSetPageState extends State<ActionMenuSetPage> {
.map<String>((i) => (i['value'] as ActionType).value)
.toList();
setting.put(SettingBoxKey.actionTypeSort, sortedTabbar);
GlobalData().actionTypeSort = sortedTabbar;
GlobalDataCache().actionTypeSort = sortedTabbar;
SmartDialog.showToast('操作成功');
}

View File

@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import 'package:pilipala/utils/global_data.dart';
import 'package:pilipala/utils/global_data_cache.dart';
import '../../../models/common/gesture_mode.dart';
import '../../../utils/storage.dart';
@ -64,11 +64,11 @@ class _PlayGesturePageState extends State<PlayGesturePage> {
},
);
if (result != null) {
GlobalData().fullScreenGestureMode = FullScreenGestureMode
GlobalDataCache().fullScreenGestureMode = FullScreenGestureMode
.values
.firstWhere((element) => element.values == result);
fullScreenGestureMode =
GlobalData().fullScreenGestureMode.index;
GlobalDataCache().fullScreenGestureMode.index;
setting.put(
SettingBoxKey.fullScreenGestureMode, fullScreenGestureMode);
setState(() {});