newFileMemoryCacheStore function

Future<FileCacheStore> newFileMemoryCacheStore({
  1. String? path,
  2. StoreCodec? codec,
})

Creates a new in-memory FileCacheStore

  • path: The base storage location for this store
  • codec: The StoreCodec used to convert to/from a Map<String, dynamic>` representation to a binary representation

Implementation

Future<FileCacheStore> newFileMemoryCacheStore(
    {String? path, StoreCodec? codec}) {
  FileSystem fs = MemoryFileSystem();

  return FileAdapter.build(fs, path ?? fs.systemTempDirectory.path)
      .then((adapter) => FileCacheStore(adapter, false, codec: codec));
}