Blob.fromStream constructor

Blob.fromStream(
  1. String contentType,
  2. Stream<Uint8List> stream
)

Creates a Blob from a stream of chunks of data.

Usually, an unsaved Blob is saved when a Document that contains it is saved. This is not possible for Blobs created from a stream, when the Document is being saved into a SyncDatabase. In this case, the Blob must be saved explicitly, with Database.saveBlob.

Implementation

factory Blob.fromStream(String contentType, Stream<Uint8List> stream) =>
    BlobImpl.fromStream(contentType, stream);