readGeneral method

Future<Object?> readGeneral({
  1. required int key,
  2. String? pw,
})

Implementation

Future<Object?> readGeneral({
  required int key,
  String? pw,
}) async {
  await _ensureInit(pw: pw);
  final HiveAesCipher? cipher = cipherFromKey(key: pw);
  final Box<Object> box;
  if (!Hive.isBoxOpen('general')) {
    box = await Hive.openBox('general', encryptionCipher: cipher);
  } else {
    box = Hive.box('general');
  }
  return box.get(key);
}