openBlob function

Future<BlitFile> openBlob(
  1. JSObject blob, {
  2. int cacheLimit = 8 << 20,
})

Opens an immutable Web Blob/File through the simple facade.

Implementation

Future<BlitFile> openBlob(JSObject blob, {int cacheLimit = 8 << 20}) async {
  final backend = await web.openBlobBytesFile(blob, cacheLimit: cacheLimit);
  return BlitFile.fromFile(
    AsyncFile.fromBackend(
      '<blob>',
      backend,
      options: const FileOptions(mode: FileMode.read, create: false),
    ),
  );
}