opt: search page

This commit is contained in:
guozhigq
2024-10-19 13:29:18 +08:00
parent fa79b92f82
commit c755e8a60f
6 changed files with 138 additions and 95 deletions

View File

@ -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();