SodiumHiveLocalStorage constructor

SodiumHiveLocalStorage({
  1. required HiveInterface hive,
  2. required Sodium sodium,
  3. required SecureKey encryptionKey,
  4. FutureOr<String> baseDirFn()?,
  5. bool? clear,
})

Constructor.

Both sodium and encryptionKey are required to initialize the storage, as the storage will always be encrypted. You can use SodiumHiveCipher.keyBytes to create a SecureKey of the correct length.

The hive, baseDirFn and clear are simply forwarded to the HiveLocalStorage.new constructor.

Implementation

SodiumHiveLocalStorage({
  required HiveInterface hive,
  required Sodium sodium,
  required SecureKey encryptionKey,
  FutureOr<String> Function()? baseDirFn,
  bool? clear,
})  : _sodiumHiveCipher = _FakeAesSodiumHiveCipher(
        sodium: sodium,
        encryptionKey: encryptionKey,
      ),
      super(
        hive: hive,
        baseDirFn: baseDirFn,
        clear: clear,
      );