AsyncListenable<T> mixin

Signature for a read-only AsyncSnapshot listener.

Superclass constraints
Implemented types
Available extensions

Properties

connectionState ConnectionState
Current state of connection to the asynchronous computation.
no setteroverride
data → T?
The latest data received by the asynchronous computation.
no setteroverride
error Object?
The latest error object received by the asynchronous computation.
no setteroverride
errorMessage String?

Available on AsyncSnapshot<T>, provided by the AsyncSnapshotExtension extension

Returns the error message if the error is an Exception with a message, otherwise returns the string representation of the error.
no setter
errorMessage String?

Available on AsyncSnapshot<T>, provided by the FlutterAsyncSnapshotExtension extension

The error message of this AsyncSnapshot.error.
no setter
hasData bool
Returns whether this snapshot contains a non-null data value.
no setteroverride
hasError bool
Returns whether this snapshot contains a non-null error value.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
hasNone bool

Available on AsyncSnapshot<T>, provided by the AsyncSnapshotExtension extension

Returns whether this snapshot has neither data/error.
no setter
isLoading bool

Available on AsyncSnapshot<T>, provided by the AsyncSnapshotExtension extension

Returns whether this snapshot is computing.
no setter
isReloading bool

Available on AsyncSnapshot<T>, provided by the AsyncSnapshotExtension extension

Returns whether this snapshot is computing and has data/error.
no setter
requireData → T
Returns latest data received, failing if there is no data.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
The latest stack trace object received by the asynchronous computation.
no setteroverride
value AsyncSnapshot<T>
The current value of the object. When the value changes, the callbacks registered with addListener will be invoked.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object notifies its listeners.
inherited
inState(ConnectionState state) AsyncSnapshot<T>
Returns a snapshot like this one, but in the specified state.
override
maybeWhen<R>({bool skipLoading = false, R data(T data)?, R error(Object error, StackTrace stackTrace)?, R loading()?, R none()?, required R orElse()}) → R

Available on AsyncSnapshot<T>, provided by the AsyncSnapshotExtension extension

Allows you to define custom behavior for different states of an AsyncSnapshot by providing callbacks for data, error, loading, and none.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies.
inherited
toString() String
A string representation of this object.
inherited
when<R>({bool skipLoading = false, required R data(T data), required R error(Object error, StackTrace stackTrace), required R loading(), R none()?}) → R

Available on AsyncSnapshot<T>, provided by the AsyncSnapshotExtension extension

Allows you to define custom behavior for different states of an AsyncSnapshot by providing callbacks for data, error, loading, and none.
whenData<R>(R map(T data)) AsyncSnapshot<R>

Available on AsyncSnapshot<T>, provided by the AsyncSnapshotExtension extension

Applies map when this snapshot hasData.
whenError(Object map(Object error)) AsyncSnapshot<T>

Available on AsyncSnapshot<T>, provided by the AsyncSnapshotExtension extension

Applies map when this snapshot hasError.
whenOrNull<R>({bool skipLoading = false, R data(T data)?, R error(Object error, StackTrace stackTrace)?, R loading()?, R none()?}) → R?

Available on AsyncSnapshot<T>, provided by the AsyncSnapshotExtension extension

Allows you to define custom behavior for different states of an AsyncSnapshot by providing callbacks for data, error, loading, and none.

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator >>(ChangeNotifier other) → T

Available on T, provided by the ListenableSyncExtension extension

Sends notifications to a ChangeNotifier.