WebScopedStorageXFileCreationParams.fromBytes constructor

WebScopedStorageXFileCreationParams.fromBytes(
  1. Uint8List bytes, {
  2. String? fileName,
  3. bool autoRevokeObjectUrl = true,
  4. @visibleForTesting Object? testOverrides,
})

Constructs a WebScopedStorageXFileCreationParams by creating a Blob from bytes.

Creates an Object URL from the Blob created from the provided bytes. See URL.createObjectURL.

If a fileName is provided, the underlying Blob is created as a File with the fileName passed to it.

autoRevokeObjectUrl: Whether the created object url should be revoked when this instance is garbage collected. See URL.revokeObjectURL.

This is a stub for the method in web_scoped_storage_cross_file.dart.

Implementation

factory WebScopedStorageXFileCreationParams.fromBytes(
  // ignore: avoid_unused_constructor_parameters
  Uint8List bytes, {
  // ignore: avoid_unused_constructor_parameters
  String? fileName,
  // ignore: avoid_unused_constructor_parameters
  bool autoRevokeObjectUrl = true,
  // The type should be a `XFileTestOverrides`. It can't be imported in this
  // stub without breaking other platforms.
  // ignore: avoid_unused_constructor_parameters
  @visibleForTesting Object? testOverrides,
}) => throw UnsupportedError(
  '`WebScopedStorageXFileCreationParams.fromBytes` is only supported on web.',
);