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<
Returns the error message if the error is an Exception with a message, otherwise returns the string representation of the error.T> , provided by the AsyncSnapshotExtension extensionno setter - errorMessage → String?
-
Available on AsyncSnapshot<
The error message of this AsyncSnapshot.error.T> , provided by the FlutterAsyncSnapshotExtension extensionno 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<
Returns whether this snapshot has neither data/error.T> , provided by the AsyncSnapshotExtension extensionno setter - isLoading → bool
-
Available on AsyncSnapshot<
Returns whether this snapshot is computing.T> , provided by the AsyncSnapshotExtension extensionno setter - isReloading → bool
-
Available on AsyncSnapshot<
Returns whether this snapshot is computing and has data/error.T> , provided by the AsyncSnapshotExtension extensionno 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<
Allows you to define custom behavior for different states of an AsyncSnapshot by providing callbacks forT> , provided by the AsyncSnapshotExtension extensiondata,error,loading, andnone. -
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<
Allows you to define custom behavior for different states of an AsyncSnapshot by providing callbacks forT> , provided by the AsyncSnapshotExtension extensiondata,error,loading, andnone. -
whenData<
R> (R map(T data)) → AsyncSnapshot< R> -
Available on AsyncSnapshot<
AppliesT> , provided by the AsyncSnapshotExtension extensionmapwhen this snapshot hasData. -
whenError(
Object map(Object error)) → AsyncSnapshot< T> -
Available on AsyncSnapshot<
AppliesT> , provided by the AsyncSnapshotExtension extensionmapwhen 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<
Allows you to define custom behavior for different states of an AsyncSnapshot by providing callbacks forT> , provided by the AsyncSnapshotExtension extensiondata,error,loading, andnone.
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.