update method

void update(
  1. void updateFn(
    1. T value
    )
)

Mutates the current value in place and always notifies listeners.

Use this for values that are modified rather than replaced, where the == check in value would swallow the change:

state.filters.update((f) => f.add('unread'));

Implementation

void update(void Function(T value) updateFn) {
  updateFn(_value);
  notifyListeners();
}