opt.: migrate to new fl_lib (#649)

Fixes #648
This commit is contained in:
lollipopkit🏳️‍⚧️
2024-12-02 21:06:44 +08:00
committed by GitHub
parent b882baeafa
commit ddd32e82d4
50 changed files with 10858 additions and 225 deletions

View File

@@ -2,14 +2,13 @@ import 'package:fl_lib/fl_lib.dart';
import 'package:server_box/data/model/server/private_key_info.dart';
class PrivateKeyStore extends PersistentStore {
class PrivateKeyStore extends HiveStore {
PrivateKeyStore._() : super('key');
static final instance = PrivateKeyStore._();
void put(PrivateKeyInfo info) {
box.put(info.id, info);
box.updateLastModified();
set(info.id, info);
}
List<PrivateKeyInfo> fetch() {
@@ -24,13 +23,12 @@ class PrivateKeyStore extends PersistentStore {
return ps;
}
PrivateKeyInfo? get(String? id) {
PrivateKeyInfo? fetchOne(String? id) {
if (id == null) return null;
return box.get(id);
}
void delete(PrivateKeyInfo s) {
box.delete(s.id);
box.updateLastModified();
remove(s.id);
}
}