AsyncSnapshot<T> class

An immutable representation of the most recent interaction with an asynchronous computation.

Constructors

AsyncSnapshot.nothing()
factory
AsyncSnapshot.waiting()
factory
AsyncSnapshot.withData({required ConnectionState connectionState, required T data})
factory
AsyncSnapshot.withError({required ConnectionState connectionState, required Object error, StackTrace stackTrace = StackTrace.empty})
factory

Properties

connectionState ConnectionState
final
data → T?
final
error Object?
final
hasData bool
no setter
hasError bool
no setter
hashCode int
The hash code for this object.
no setterinherited
requireData → T
Returns the data. An error is thrown if data is null.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackTrace StackTrace?
final

Methods

inConnectionState(ConnectionState connectionState) AsyncSnapshot<T>
Returns a copy of the current AsyncSnapshot with the given connectionState.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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