ResourceLoading<T> class
Loading state - data is being fetched.
- Inheritance
-
- Object
- ResourceState<
T> - ResourceLoading
Constructors
- ResourceLoading({T? previousData})
-
const
Properties
- dataOrNull → T?
-
Gets the data if available, or null.
no setterinherited
- errorOrNull → FKernalError?
-
Gets the error if present, or null.
no setterinherited
- hasData → bool
-
Whether data has been loaded successfully.
no setterinherited
- hasError → bool
-
Whether an error occurred.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLoading → bool
-
Whether data is currently loading.
no setterinherited
- previousData → T?
-
Optional previous data (for refresh scenarios).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
maybeWhen<
R> ({R loading()?, R onData(T data)?, R onError(FKernalError error)?, R initial()?, R orElse()?}) → R? -
Maps the state, with optional handlers (returns null for unhandled cases).
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
R> ({required R loading(), required R onData(T data), required R onError(FKernalError error), R initial()?}) → R -
Maps the state to a value using the provided functions.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited