upsert static method
Implementation
static Future<Exception?> upsert(
String table,
String key,
Map<String, dynamic> map) async {
if (!initialized) return null;
Exception? exception;
try {
var box = await Hive.openBox(table);
await box.put(key, map);
} on Exception catch (e) {
Log().error(
'Error Inserting/Updating Record Key [$key] in Table [$table]');
Log().exception(e,
caller: 'Future<Exception?> update($table, $key, $map) async');
exception = e;
}
return exception;
}