mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
29 lines
591 B
Dart
29 lines
591 B
Dart
import 'package:toolbox/core/persistant_store.dart';
|
|
import 'package:toolbox/data/model/server/private_key_info.dart';
|
|
|
|
class PrivateKeyStore extends PersistentStore {
|
|
void put(PrivateKeyInfo info) {
|
|
box.put(info.id, info);
|
|
}
|
|
|
|
List<PrivateKeyInfo> fetch() {
|
|
final keys = box.keys;
|
|
final ps = <PrivateKeyInfo>[];
|
|
for (final key in keys) {
|
|
final s = box.get(key);
|
|
if (s != null) {
|
|
ps.add(s);
|
|
}
|
|
}
|
|
return ps;
|
|
}
|
|
|
|
PrivateKeyInfo get(String id) {
|
|
return box.get(id);
|
|
}
|
|
|
|
void delete(PrivateKeyInfo s) {
|
|
box.delete(s.id);
|
|
}
|
|
}
|