whereTo method

void whereTo(
  1. List<E> destination,
  2. bool predicate(
    1. E element
    )
)

Appends all elements matching the given predicate to the given destination.

Implementation

void whereTo(List<E> destination, bool Function(E element) predicate) {
  for (var element in this) {
    if (predicate(element)) {
      destination.add(element);
    }
  }
}