set method
void
set(
- T update(
- T previous
Functional update: applies update to the current value, then value=.
Prefer this in async handlers to avoid read-modify-write races.
Implementation
void set(T Function(T previous) update) => value = update(_value);