loadFromStorage static method
Loads an SimpleOpfsFileSystem in the desired path
under the root directory
for OPFS as given by navigator.storage.getDirectory()
in JavaScript.
Throws a VfsException if OPFS is not available - please note that this file system implementation requires a recent browser and only works in dedicated web workers.
Implementation
static Future<SimpleOpfsFileSystem> loadFromStorage(String path,
{String vfsName = 'simple-opfs'}) async {
final storage = storageManager;
if (storage == null) {
throw VfsException(SqlError.SQLITE_ERROR);
}
final (_, directory) = await _resolveDir(path);
return inDirectory(directory, vfsName: vfsName);
}