newSembastMemoryCacheStore function
Future<SembastCacheStore>
newSembastMemoryCacheStore({
- StoreCodec? codec,
- int? databaseVersion,
- OnVersionChangedFunction? onVersionChanged,
- DatabaseMode? databaseMode,
- SembastCodec? sembastCodec,
Creates a new in-memory SembastCacheStore
codec
: TheStoreCodec
used to convert to/from a Map<String, dynamic>` representation to a binary representationdatabaseVersion
: The expected versiononVersionChanged
: IfdatabaseVersion
not null and if the existing version is different, onVersionChanged is calleddatabaseMode
: The database modesembastCodec
: 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));
}