modify method

void modify(
  1. List<E> applyChanges(
    1. List<E> list
    )
)

allows to perform multiple changes to the list, and only notify listeners after all changes are through.

Implementation

void modify(List<E> Function(List<E> list) applyChanges) {
  _list = applyChanges(_list);
  notifyListeners();
}