newSembastLocalCacheStore function
Creates a new SembastCacheStore on a file
path
: The location of this store, if not provided defaults to "stash_sembast.db"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> newSembastLocalCacheStore(
{String? path,
StoreCodec? codec,
int? databaseVersion,
OnVersionChangedFunction? onVersionChanged,
DatabaseMode? databaseMode,
SembastCodec? sembastCodec}) {
return SembastLocalAdapter.build(path ?? 'cache.db',
version: databaseVersion,
onVersionChanged: onVersionChanged,
mode: databaseMode,
sembastCodec: sembastCodec)
.then((adapter) => SembastCacheStore(adapter, codec: codec));
}