delete method

Future<Exception?> delete(
  1. String table,
  2. String key
)

Implementation

Future<Exception?> delete(String table, String key) async
{
  Exception? exception;
  try
  {
    if (!_initialized) return null;
    var box = await Hive.openBox(table);
    if (box.containsKey(key))
    {
      await box.delete(key);
    }
  }
  on Exception catch(e)
  {
    Log().error('Error Deleting Record Key [$key] in Table [$table]');
    Log().exception(e, caller: 'Future<Exception?> delete($table, $key) async');
    exception = e;
  }
  return exception;
}