ImageStream class Null safety

A handle to an image resource.

ImageStream represents a handle to a dart:ui.Image object and its scale (together represented by an ImageInfo object). The underlying image object might change over time, either because the image is animating or because the underlying image resource was mutated.

ImageStream objects can also represent an image that hasn't finished loading.

ImageStream objects are backed by ImageStreamCompleter objects.

The ImageCache will consider an image to be live until the listener count drops to zero after adding at least one listener. The ImageStreamCompleter.addOnLastListenerRemovedCallback method is used for tracking this information.

See also:

Mixed in types

Constructors

ImageStream()
Create an initially unbound image stream.

Properties

completer ImageStreamCompleter?
The completer that has been assigned to this image stream.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
key Object
Returns an object which can be used with == to determine if this ImageStream shares the same listeners list as another ImageStream.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

addListener(ImageStreamListener listener) → void
Adds a listener callback that is called whenever a new concrete ImageInfo object is available. If a concrete image is already available, this object will call the listener synchronously.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
removeListener(ImageStreamListener listener) → void
Stops listening for events from this stream's ImageStreamCompleter.
setCompleter(ImageStreamCompleter value) → void
Assigns a particular ImageStreamCompleter to this ImageStream.
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

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