open static method

Future<IndexedDbFileSystem> open({
  1. required String dbName,
  2. String vfsName = 'indexeddb',
  3. Random? random,
  4. bool writeAutomatically = true,
})

Loads an IndexedDB file system identified by the dbName.

Each file system with a different name will store an independent file system.

The writeAutomatically parameter controls how writes are persisted in IndexedDB. When enabled (the default), writes are asynchronously written to IndexedDB without any durability guarantees. You can invoke flush to force a transaction, though. When disabled, no IndexedDB writes are scheduled by default. Instead, all writes are batched up until flush is called explicitly. This allows being more explicit about when to write to IndexedDB.

Implementation

static Future<IndexedDbFileSystem> open({
  required String dbName,
  String vfsName = 'indexeddb',
  Random? random,
  bool writeAutomatically = true,
}) async {
  final fs = IndexedDbFileSystem._(dbName, vfsName: vfsName, random: random);
  fs._writeAutomatically = writeAutomatically;
  await fs._asynchronous.open();
  await fs._readFiles();
  return fs;
}