update method
T
update(
- T updater(
- T value
Replaces the value by calculating a new value from the current value.
This is useful for immutable list/map updates:
answers.update((items) => [...items, newAnswer]);
Implementation
T update(T Function(T value) updater) {
final next = updater(_value);
set(next);
return next;
}