opt: 数据初始化
This commit is contained in:
@ -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('操作成功');
|
||||
}
|
||||
|
||||
|
||||
@ -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(() {});
|
||||
|
||||
Reference in New Issue
Block a user