newHiveDefaultCacheStore function

Future<HiveDefaultCacheStore> newHiveDefaultCacheStore({
  1. String? path,
  2. StoreCodec? codec,
  3. HiveCipher? encryptionCipher,
  4. bool? crashRecovery,
})

Creates a new HiveDefaultCacheStore

  • path: The base storage location for this store, the current directoy if not provided
  • codec: The StoreCodec used to convert to/from a Map<String, dynamic>` representation to a binary representation
  • encryptionCipher: The encryption cypher
  • crashRecovery: If it supports crash recovery

Implementation

Future<HiveDefaultCacheStore> newHiveDefaultCacheStore(
    {String? path,
    StoreCodec? codec,
    HiveCipher? encryptionCipher,
    bool? crashRecovery}) {
  return HiveDefaultAdapter.build(
          path: path ?? '.',
          encryptionCipher: encryptionCipher,
          crashRecovery: crashRecovery)
      .then((adapter) => HiveDefaultCacheStore(adapter, codec: codec));
}