openIndexedDb function
Opens an IndexedDB-backed file through the simple facade.
Implementation
Future<BlitFile> openIndexedDb(
String path, {
bool create = true,
bool readOnly = false,
int chunkSize = web.kIdbDefaultChunkSize,
String databaseName = web.kIdbDatabaseName,
String storeName = web.kIdbStoreName,
}) async {
final backend = await web.openIdbBytesFile(
path,
create: create,
readOnly: readOnly,
chunkSize: chunkSize,
databaseName: databaseName,
storeName: storeName,
);
return BlitFile.fromFile(
AsyncFile.fromBackend(
path,
backend,
options: FileOptions(
mode: readOnly ? FileMode.read : FileMode.readWrite,
create: create,
),
),
);
}