SnapState<T> class

Snap representation of the state

Available Extensions
Annotations

Constructors

SnapState.data([T? data])
const
SnapState.error(dynamic err, [StackTrace? s, VoidCallback? refresher])
factory
SnapState.none()
const
SnapState.waiting()
const

Properties

data → T?
The latest data received by the asynchronous computation.
final
error → dynamic
The latest error object 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 setteroverride
isActive bool
final
isDone bool
final
isIdle bool
Where the reactive state is in the initial state
no setter
isWaiting bool
Where the reactive state is in the waiting for an asynchronous task to resolve
no setter
onErrorRefresher → (void Function()?)
final
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
state → T
Similar to data with the particularity that it is non nullable.
no setter

Methods

copyTo({bool? isWaiting, bool? isIdle, bool? isActive, T? data, dynamic error, StackTrace? stackTrace}) SnapState<T>
copyToHasData(T? data) SnapState<T>
copyToHasError(dynamic error, {StackTrace? stackTrace, void onErrorRefresher()?, T? data, bool enableNull = false}) SnapState<T>
copyToIsDone() SnapState<T>
copyToIsIdle([T? data]) SnapState<T>
copyToIsWaiting() SnapState<T>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAll<R>({R onIdle()?, required R onWaiting()?, required R onError(dynamic error, VoidCallback refreshError)?, required R onData(T data)}) → R
onOrElse<R>({R onIdle()?, R onWaiting()?, R onError(dynamic error, VoidCallback refreshError)?, R onData(T data)?, required R orElse(T data)}) → R
toString() String
A string representation of this object.
override
toStringShort() String
type() Type

Operators

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