Blob class Null safety Document

A Blob contains arbitrary binary data, tagged with a MIME type.

Blobs can be arbitrarily large, and their data is loaded only on demand (when the content or contentStream properties are accessed), not when the Document is loaded. The document’s raw JSON form only contains the Blob’s metadata (type, length and a digest of the data) in a small object. The data itself is stored externally to the document, keyed by the digest.

Annotations

Constructors

Blob.fromData(String contentType, Uint8List data)
Creates a Blob with the given in-memory data.
factory

Properties

contentType String?
The type of content this Blob represents. [...]
read-only
digest String?
The cryptographic digest of this Blob’s content, which uniquely identifies it.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
length int?
The binary length of this Blob.
read-only
properties Map<String, Object?>
The metadata associated with this Blob.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

content() Future<Uint8List>
Gets the contents of this Blob as a block of memory. [...]
contentStream() Stream<Uint8List>
A stream of the content of this Blob.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toJson() String
Returns this blob's JSON representation.
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

fromStream(String contentType, Stream<Uint8List> stream, Database database) Future<Blob>
Creates a Blob from a stream of chunks of data.
isBlob(Map<String, Object?> properties) bool
Wether a plain Dart Map represents a Blob.