newSembastMemoryCacheStore function

Future<SembastCacheStore> newSembastMemoryCacheStore({
  1. StoreCodec? codec,
  2. int? databaseVersion,
  3. OnVersionChangedFunction? onVersionChanged,
  4. DatabaseMode? databaseMode,
  5. SembastCodec? sembastCodec,
})

Creates a new in-memory SembastCacheStore

  • codec: The StoreCodec used to convert to/from a Map<String, dynamic>` representation to a binary representation
  • databaseVersion: The expected version
  • onVersionChanged: If databaseVersion not null and if the existing version is different, onVersionChanged is called
  • databaseMode: The database mode
  • sembastCodec: The codec which can be used to load/save a record, allowing for user encryption

Implementation

Future<SembastCacheStore> newSembastMemoryCacheStore(
    {StoreCodec? codec,
    int? databaseVersion,
    OnVersionChangedFunction? onVersionChanged,
    DatabaseMode? databaseMode,
    SembastCodec? sembastCodec}) {
  return SembastMemoryAdapter.build('sembast',
          version: databaseVersion,
          onVersionChanged: onVersionChanged,
          mode: databaseMode,
          sembastCodec: sembastCodec)
      .then((adapter) => SembastCacheStore(adapter, codec: codec));
}