countWhere method

int countWhere(
  1. bool test(
    1. T element
    )
)

Counts elements that match the test

Implementation

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