mod: userInfo cache
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/models/play_speed.dart';
|
import 'package:pilipala/plugin/pl_player/models/play_speed.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
@ -7,6 +8,7 @@ import '../models/common/index.dart';
|
|||||||
Box setting = GStrorage.setting;
|
Box setting = GStrorage.setting;
|
||||||
Box localCache = GStrorage.localCache;
|
Box localCache = GStrorage.localCache;
|
||||||
Box videoStorage = GStrorage.video;
|
Box videoStorage = GStrorage.video;
|
||||||
|
Box userInfoCache = GStrorage.userInfo;
|
||||||
|
|
||||||
class GlobalDataCache {
|
class GlobalDataCache {
|
||||||
late int imgQuality;
|
late int imgQuality;
|
||||||
@ -39,6 +41,8 @@ class GlobalDataCache {
|
|||||||
late double longPressSpeed;
|
late double longPressSpeed;
|
||||||
// 播放器速度列表
|
// 播放器速度列表
|
||||||
late List<double> speedsList;
|
late List<double> speedsList;
|
||||||
|
// 用户信息
|
||||||
|
UserInfoData? userInfo;
|
||||||
|
|
||||||
// 私有构造函数
|
// 私有构造函数
|
||||||
GlobalDataCache._();
|
GlobalDataCache._();
|
||||||
@ -96,5 +100,7 @@ class GlobalDataCache {
|
|||||||
final List<double> playSpeedSystem = await videoStorage
|
final List<double> playSpeedSystem = await videoStorage
|
||||||
.get(VideoBoxKey.playSpeedSystem, defaultValue: playSpeed);
|
.get(VideoBoxKey.playSpeedSystem, defaultValue: playSpeed);
|
||||||
speedsList.addAll(playSpeedSystem);
|
speedsList.addAll(playSpeedSystem);
|
||||||
|
|
||||||
|
userInfo = userInfoCache.get('userInfoCache');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user