update method
void
update(
- dynamic updateFunction(
- T value
Updates the state with a new value using the provided update function. Maintains immutability by creating a new instance of the value.
Implementation
void update(Function(T value) updateFunction) {
final newValue = _value;
updateFunction(newValue);
_value = newValue;
_listener?.call();
}