Ease<T> class
The Ease class provides a simple state management system with additional features such as error handling, loading state, and batch operations.
Constructors
- Ease(T _value)
- Constructor for creating a new instance of Ease with an initial value.
Properties
- error ↔ dynamic
-
Getter for retrieving the current error state of Ease.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isLoading ↔ bool
-
Getter for retrieving the current loading state of Ease.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ T
-
Getter for retrieving the current value of Ease.
getter/setter pair
Methods
-
add(
dynamic value) → void - Adds a value to the state. Throws an error if the state is not a List.
-
addListener(
VoidCallback listener) → void - Adds a listener function to be called when the state changes.
-
clearError(
) → void - Clears the current error state of Ease and notifies listeners.
-
filter(
bool predicate(T value)) → List< T> - Filters the list based on the provided predicate function.
-
map<
U> (U mapper(T value)) → List< U> - Maps each element in the list to a new value using the provided mapper function.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeListener(
VoidCallback listener) → void - Removes a listener function to stop receiving state change notifications.
-
reset(
{T? defaultValue}) → void - Resets the state to a default value or the initial value and notifies listeners.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
dynamic updateFunction(T value)) → void - Updates the state with a new value using the provided update function. Maintains immutability by creating a new instance of the value.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited