mod: 本地缓存历史记录状态

This commit is contained in:
guozhigq
2023-07-24 15:12:00 +08:00
parent ee973167a5
commit 4e64c74ee0
5 changed files with 32 additions and 1 deletions

16
lib/utils/data.dart Normal file
View File

@ -0,0 +1,16 @@
import 'package:hive/hive.dart';
import 'package:pilipala/http/user.dart';
import 'storage.dart';
class Data {
static Future init() async {
await historyStatus();
}
static Future historyStatus() async {
Box localCache = GStrorage.localCache;
var res = await UserHttp.historyStatus();
localCache.put(LocalCacheKey.historyStatus, res.data['data']);
}
}

View File

@ -59,3 +59,8 @@ class UserBoxKey {
class SettingBoxKey {
static const String themeMode = 'themeMode';
}
class LocalCacheKey {
// 历史记录暂停状态 默认false
static const String historyStatus = 'historyStatus';
}