ResourceState<T> class
sealed
Manages all the different states of a Resource:
- ResourceReady
- ResourceLoading
- ResourceError
- Implementers
- Available Extensions
- Annotations
-
- @sealed
- @immutable
Constructors
- ResourceState.error(Object error, {StackTrace? stackTrace, bool isRefreshing})
-
Creates an ResourceState in error state.
constfactory
- ResourceState.loading()
-
Creates an ResourceState in loading state.
constfactory
- ResourceState.ready(T data, {bool isRefreshing})
-
Creates an ResourceState with a data.
constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
R> ({required R ready(ResourceReady< T> ready), required R error(ResourceError<T> error), required R loading(ResourceLoading<T> loading)}) → R -
private mapper, so that classes inheriting Resource can specify their own
map
method with different parameters. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited