ValueState<T> class
A reactive state holder that can be externally updated and refreshed.
Ideal for state that does not need an initial value at creation time. The state is null-safe but must be initialized via refreshWith or refreshUpdate.
Constructors
- ValueState.new()
- Creates a new ValueState with an auto-generated key.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on(
Widget build(T)) → StateBuilder - Associates this state with a reactive widget built using the given function.
-
refreshUpdate(
T update(T?)) → void -
Updates the current state using a functional transformer
update
, which receives the previous state and returns the new one. -
refreshWith(
T newState) → void -
Replaces the current state with
newState
and triggers a widget rebuild. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited