create static method
Creates a new SembastCacheManager instance.
Platform-specific behavior:
- Web platform:
databasePathis ignored. The database is stored in IndexedDB usingdatabaseNameas the database name. - Native platforms (Android, iOS, macOS, Linux, Windows):
databasePathis required. The database file is created at{databasePath}/{databaseName}.db.
Parameters:
databasePath: Required on native platforms, ignored on web.databaseName: Name of the database. Defaults to "sembast_cache_manager".
Throws ArgumentError on native platforms if databasePath is null or empty.
Implementation
static Future<SembastCacheManager> create({
String? databasePath,
String databaseName = "sembast_cache_manager",
}) async {
final database = await openDatabase(
databasePath: databasePath,
databaseName: databaseName,
);
return SembastCacheManager(database);
}