all method

bool all(
  1. bool test(
    1. E element
    )
)

Returns true if all elements satisfy the given test, or if the collection is empty.

Implementation

bool all(bool Function(E element) test) {
  for (final element in this) {
    if (test(element)) continue;
    return false;
  }
  return true;
}