insert method
Implementation
Future<Exception?> insert(String table, String key, Map<String, dynamic> map, {bool logExceptions = true}) async
{
Exception? exception;
try
{
if (!_initialized) return null;
var box = await Hive.openBox(table);
await box.put(key, map);
}
on Exception catch(e)
{
// log calling insert causes an infinite loop on error
// we pass logExceptions=false to prevent this
if (logExceptions)
{
Log().error('Error Inserting Record Key [$key] into Table [$table]');
Log().exception(e, caller: 'Future<Exception?> insert(String table, dynamic key, dynamic record) async');
}
exception = e;
}
return exception;
}