使用 Hive Object

This commit is contained in:
Junyuan Feng
2022-11-05 23:08:56 +08:00
parent c036b78708
commit 398c49bb99
20 changed files with 504 additions and 102 deletions

View File

@@ -26,7 +26,7 @@ class PrivateKeyProvider extends BusyProvider {
void updateInfo(PrivateKeyInfo old, PrivateKeyInfo newInfo) {
final idx = _infos.indexWhere((e) => e.id == old.id);
_infos[idx] = newInfo;
locator<PrivateKeyStore>().update(old, newInfo);
locator<PrivateKeyStore>().put(newInfo);
notifyListeners();
}
}

View File

@@ -38,7 +38,7 @@ class SnippetProvider extends BusyProvider {
void update(Snippet old, Snippet newOne) {
if (!have(old)) return;
_snippets[index(old)] = newOne;
locator<SnippetStore>().update(old, newOne);
locator<SnippetStore>().put(newOne);
notifyListeners();
}