opt: search page
This commit is contained in:
@ -45,6 +45,8 @@ class GlobalDataCache {
|
||||
late List<double> speedsList;
|
||||
// 用户信息
|
||||
UserInfoData? userInfo;
|
||||
// 搜索历史
|
||||
late List historyCacheList;
|
||||
|
||||
// 私有构造函数
|
||||
GlobalDataCache._();
|
||||
@ -105,5 +107,6 @@ class GlobalDataCache {
|
||||
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
sheetHeight = localCache.get('sheetHeight');
|
||||
historyCacheList = localCache.get('cacheList', defaultValue: []);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@ import 'package:pilipala/models/user/info.dart';
|
||||
|
||||
class GStrorage {
|
||||
static late final Box<dynamic> userInfo;
|
||||
static late final Box<dynamic> historyword;
|
||||
static late final Box<dynamic> localCache;
|
||||
static late final Box<dynamic> setting;
|
||||
static late final Box<dynamic> video;
|
||||
@ -26,18 +25,11 @@ class GStrorage {
|
||||
localCache = await Hive.openBox(
|
||||
'localCache',
|
||||
compactionStrategy: (int entries, int deletedEntries) {
|
||||
return deletedEntries > 4;
|
||||
return deletedEntries > 10;
|
||||
},
|
||||
);
|
||||
// 设置
|
||||
setting = await Hive.openBox('setting');
|
||||
// 搜索历史
|
||||
historyword = await Hive.openBox(
|
||||
'historyWord',
|
||||
compactionStrategy: (int entries, int deletedEntries) {
|
||||
return deletedEntries > 10;
|
||||
},
|
||||
);
|
||||
// 视频设置
|
||||
video = await Hive.openBox('video');
|
||||
}
|
||||
@ -52,8 +44,6 @@ class GStrorage {
|
||||
// user.close();
|
||||
userInfo.compact();
|
||||
userInfo.close();
|
||||
historyword.compact();
|
||||
historyword.close();
|
||||
localCache.compact();
|
||||
localCache.close();
|
||||
setting.compact();
|
||||
|
||||
Reference in New Issue
Block a user