SnapState<T> class
Snap representation of the state
- Annotations
Constructors
- SnapState.none({T? data, String debugName = '', Object? toDebugString(T?)?, String infoMessage = ''})
-
Create a SnapState in idle state
const
Properties
- data → T?
-
The latest data received by the asynchronous computation.
final
- hasData → bool
-
Wether the state is in the data status
no setter
- hasError → bool
-
Wether the state is in the error status
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- isIdle → bool
-
Wether the state is in the idle status
no setter
- isWaiting → bool
-
Wether the state is in the waiting status
no setter
-
oldSnapState
→ SnapState<
T> ? -
The old SnapState
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- snapError → SnapError?
-
The latest error object received by the asynchronous computation.
final
- state → T
-
The state
no setter
- status → StateStatus
-
The snap status StateStatus
final
Methods
-
copyToHasData(
Object? data) → SnapState< T> - Copy the state to a new state in the data status
-
copyToHasError(
dynamic error, {StackTrace? stackTrace, VoidCallback? refresher}) → SnapState< T> - Copy the state to a new state in the error status
-
copyToIsIdle(
{Object? data, String? infoMessage}) → SnapState< T> - Copy the state to a new state in the idle status
-
copyToIsWaiting(
[String? infoMessage]) → SnapState< T> - Copy the state to a new state in the waiting status
-
copyWith(
{StateStatus? status, T? data, SnapError? error, String? infoMessage, String? debugName, SnapState< T> ? oldSnapState, bool? isImmutable}) → SnapState<T> - Copy the state
-
debugPrint(
{String? debugName}) → void -
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 - Listen to the injected Model and rebuild when it emits a notification.
-
onOrElse<
R> ({R onIdle()?, R onWaiting()?, R onError(dynamic error, VoidCallback refreshError)?, R onData(T data)?, required R orElse(T data)}) → R - Listen to the injected Model and rebuild when it emits a notification.
-
toString(
) → String -
A string representation of this object.
override
-
toStringShort(
) → String -
type(
) → Type - The type of the state
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override