AsyncSnapshot<T> class
Immutable representation of the most recent interaction with an asynchronous computation.
Constructors
- AsyncSnapshot.nothing()
-
Creates an AsyncSnapshot in ConnectionState.none with null data and error.
const
- AsyncSnapshot.waiting()
-
Creates an AsyncSnapshot in ConnectionState.waiting with null data and error.
const
- AsyncSnapshot.withData(ConnectionState state, T data)
-
Creates an AsyncSnapshot in the specified
stateand with the specifieddata.const - AsyncSnapshot.withError(ConnectionState state, Object error)
-
Creates an AsyncSnapshot in the specified
stateand with the specifiederror.const
Properties
- connectionState → ConnectionState
-
Current state of connection to the asynchronous computation.
final
- data → T?
-
The latest data received by the asynchronous computation.
final
- error → Object?
-
The latest error received by the asynchronous computation.
final
- hasData → bool
-
Returns whether this snapshot contains a non-null data value.
no setter
- hasError → bool
-
Returns whether this snapshot contains a non-null error value.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
inState(
ConnectionState state) → AsyncSnapshot< T> -
Returns a copy of this snapshot in the given
state. -
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