addObject static method
Writes serialized object to a file
Implementation
static Future<void> addObject(
String key,
String modelKey,
String modelValue,
) async {
LazyBox lazyBox = Hive.lazyBox(cacheName);
Map<String, String> value;
if (lazyBox.isOpen) {
value = (await lazyBox.get(key))?.cast<String, String>() ?? {};
value.update(
modelKey,
(_) => modelValue,
ifAbsent: () => modelValue,
);
await lazyBox.put(key, value);
}
}