TreeedState<T> class
Treeed state value wrapper. Use it for wrapping a value you want to observe with updating events.
- Inheritance
-
- Object
- TreeedUpdatable<
T> - TreeedState
- Available extensions
Constructors
- TreeedState(T value)
- Treeed state value wrapper. Use it for wrapping a value you want to observe with updating events. Example:
Properties
- get → T
-
Returns the stored value.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
asyncSet(
T value) → Future< void> -
The same as
setfunction but you can await it. -
asyncTrigger(
) → Future< void> -
The same as
triggerfunction but you can await it. -
dispose(
) → void -
Clears everything.
inherited
-
listen(
void fn(T)) → void -
Adds the
fnfunction to the listeners list.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
observable(
{required Widget builder(BuildContext)}) → TreeedObservable -
Available on TreeedState, provided by the ObservableConstructExt extension
Creates anTreeedObservablebased on the state. -
quietSet(
T value) → void - Updating the stored value but without calling any listeners.
-
set(
T value) → void - Updating the stored value and calling all listeners.
-
toString(
) → String -
A string representation of this object.
inherited
-
trigger(
) → void - Triggers an updating for all listeners and providing actual value to them;
-
unlisten(
void fn(T)) → void -
Removes the
fnfunction from the listeners list.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited