openSafeBox method

Future<Box> openSafeBox(
  1. String boxKey
)

Implementation

Future<Box> openSafeBox(String boxKey) async {
  try {
    return await Hive.openBox(boxKey, encryptionCipher: HiveAesCipher(appController.secureKey));
  } catch (e) {
    await Hive.deleteBoxFromDisk(boxKey);
    return Hive.openBox(boxKey, encryptionCipher: HiveAesCipher(appController.secureKey));
  }
}