update method
void
update(
- T fn(
- T current
Updates the value using a transformation function.
Example:
counter.update((v) => v + 1);
Implementation
void update(T Function(T current) fn) {
value = fn(value);
}