clear method

  1. @override
Future<void> clear()
override

Implementation

@override
Future<void> clear() async {
  Logs().i('Clear and close hive database...');
  await _actionOnAllBoxes((box) async {
    try {
      await box.deleteAll(box.keys);
      await box.close();
    } catch (e) {
      Logs().v('Unable to clear box ${box.name}', e);
      await box.deleteFromDisk();
    }
  });
  return;
}