mutate method

void mutate(
  1. void mutator(
    1. List<E> list
    )
)

Mutate the list in-place and notify listeners.

High performance alternative to spread operators for massive lists. Bypasses object allocation and equality checks.

Implementation

void mutate(void Function(List<E> list) mutator) {
  mutator(value);
  notifyListeners();
}