LoadingState<T, E> class final

Inheritance
Available extensions

Constructors

LoadingState()
const

Properties

data → T?
Success data, or null if not in success state
no setterinherited
dataOrNull → T?

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

no setter
error FailureResponse<E>?
Error payload for failed / networkError states, null otherwise
no setterinherited
errorOrNull FailureResponse<E>?

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

no setter
hasData bool

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

no setter
hasError bool

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

no setter
hashCode int
The hash code for this object.
no setteroverride
isEmpty bool

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

no setter
isError bool

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

True for any error state (failed OR networkError)
no setter
isFailed bool

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

no setter
isIdle bool

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

no setter
isLoading bool

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

no setter
isNetworkError bool

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

no setter
isSuccess bool

Available on ApiState<T, E>, provided by the ApiStateConvenience extension

no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildWidget({required Widget loading(), required Widget success(T data), required Widget error(String message), Widget empty()?, Widget networkError()?, Widget idle()?}) Widget

Available on ApiState<T, E>, provided by the ApiStateBuildWidget extension

Build a Flutter widget directly from state – eliminates screen boilerplate.
map<R>(R transform(T data)) ApiState<R, E>
Map success data to a different type, preserving all other states
inherited
maybeWhen<R>({R idle()?, R loading()?, R success(T data)?, R empty()?, R failed(FailureResponse<E> error)?, R networkError(FailureResponse<E> error)?, required R orElse()}) → R
Partial pattern match – unhandled states fall through to orElse
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
when<R>({required R idle(), required R loading(), required R success(T data), required R empty(), required R failed(FailureResponse<E> error), required R networkError(FailureResponse<E> error)}) → R
Exhaustive pattern match over all states
inherited

Operators

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