AsyncSnapshotWithProgress<T, ProgressType extends Object> class

A custom implementation of AsyncSnapshot that also contains the progress of the async operation. This is useful for showing a loading indicator with exact progress information.

Implemented types
Available Extensions

Constructors

AsyncSnapshotWithProgress.nothing()
Creates an AsyncSnapshotWithProgress in ConnectionState.none with null data and error.
const
AsyncSnapshotWithProgress.waiting(ProgressType progress)
Creates an AsyncSnapshotWithProgress in ConnectionState.waiting with null data and error.
const
AsyncSnapshotWithProgress.withData(ConnectionState state, T data)
Creates an AsyncSnapshotWithProgress in the specified state and with the specified data.
const
AsyncSnapshotWithProgress.withError(ConnectionState state, Object error, [StackTrace stackTrace = StackTrace.empty, ProgressType? progress])
Creates an AsyncSnapshotWithProgress in the specified state with the specified error and a stackTrace.
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 object received by the asynchronous computation.
final
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
progress → ProgressType?
final
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.
final

Methods

inState(ConnectionState state) AsyncSnapshotWithProgress<T, ProgressType>
Returns a snapshot like this one, but in the specified state.
override
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