moveTo method

Iterable<T> moveTo(
  1. List<T> other, [
  2. bool predicate(
    1. T
    )?
])

Move items from one list into another list, and return these items

Implementation

Iterable<T> moveTo(List<T> other, [bool Function(T)? predicate]) {
  predicate = predicate ?? (x) => true;
  var i = detachItems(predicate);
  other.addAll(i);
  return i;
}