openBoxWithMigration<T> static method

Future<Box<T>> openBoxWithMigration<T>(
  1. String boxName,
  2. String encryptionKeyName
)

Implementation

static Future<Box<T>> openBoxWithMigration<T>(
  String boxName,
  String encryptionKeyName,
) async {
  final isMigrationComplete = await _checkMigrationStatus(boxName);

  if (!isMigrationComplete) {
    await _performMigration<T>(boxName, encryptionKeyName);
  }

  final cipher = await _getCipher(encryptionKeyName);
  return await Hive.openBox<T>(boxName, encryptionCipher: cipher);
}