countWhere method

int countWhere(
  1. bool predicate(
    1. T
    )
)

Counts elements that satisfy the given predicate.

Implementation

int countWhere(bool Function(T) predicate) {
  int count = 0;
  for (final T element in this) {
    if (predicate(element)) count++;
  }
  return count;
}