save method
Saves model of type T
with key
in local storage.
By default notifies this modification to the associated GraphNotifier.
Implementation
@override
Future<T> save(String key, T model, {bool notify = true}) async {
final keyExisted = box!.containsKey(key);
final save = box!.put(key, model);
if (notify) {
graph._notify(
[key],
keyExisted ? DataGraphEventType.updateNode : DataGraphEventType.addNode,
);
}
await save;
return model;
}