countWhere method

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

Returns count of elements that matches the given predicate. Returns -1 if iterable is null

Implementation

int countWhere(bool predicate(T element)) {
  if (this == null) return -1;
  return this!.where(predicate).length;
}