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,15 @@ import 'package:fl_lib/fl_lib.dart';
import 'package:server_box/data/model/server/server_private_info.dart';
class ServerStore extends PersistentStore {
class ServerStore extends HiveStore {
ServerStore._() : super('server');
static final instance = ServerStore._();
void put(Spi info) {
box.put(info.id, info);
box.updateLastModified();
// box.put(info.id, info);
// box.updateLastModified();
set(info.id, info);
}
List<Spi> fetch() {
@@ -25,13 +26,11 @@ class ServerStore extends PersistentStore {
}
void delete(String id) {
box.delete(id);
box.updateLastModified();
remove(id);
}
void deleteAll() {
box.clear();
box.updateLastModified();
clear();
}
void update(Spi old, Spi newInfo) {