modify method

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

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

Implementation

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