UiState<T, F> class

Available extensions
Annotations
  • @freezed

Constructors

UiState.error(F failure)
const
factory
UiState.idle()
const
factory
UiState.loading()
const
factory
UiState.success(T data)
const
factory

Properties

data → T?
no setter
hashCode int
The hash code for this object.
no setterinherited
isError bool
no setter
isIdle bool
no setter
isLoading bool
no setter
isSuccess bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>({required TResult idle(Idle<T, F> value), required TResult loading(Loading<T, F> value), required TResult error(Error<T, F> value), required TResult success(Success<T, F> value)}) → TResult

Available on UiState<T, F>, provided by the UiStatePatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? idle(Idle<T, F> value)?, TResult? loading(Loading<T, F> value)?, TResult? error(Error<T, F> value)?, TResult? success(Success<T, F> value)?}) → TResult?

Available on UiState<T, F>, provided by the UiStatePatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult idle(Idle<T, F> value)?, TResult loading(Loading<T, F> value)?, TResult error(Error<T, F> value)?, TResult success(Success<T, F> value)?, required TResult orElse()}) → TResult

Available on UiState<T, F>, provided by the UiStatePatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult idle()?, TResult loading()?, TResult error(F failure)?, TResult success(T data)?, required TResult orElse()}) → TResult

Available on UiState<T, F>, provided by the UiStatePatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult idle(), required TResult loading(), required TResult error(F failure), required TResult success(T data)}) → TResult

Available on UiState<T, F>, provided by the UiStatePatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? idle()?, TResult? loading()?, TResult? error(F failure)?, TResult? success(T data)?}) → TResult?

Available on UiState<T, F>, provided by the UiStatePatterns extension

A variant of when that fallback to returning null

Operators

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