countWhere method
Returns count of elements that matches the given predicate
.
Returns -1 if iterable is null
Implementation
int countWhere(bool Function(T element) predicate) {
if (this == null) return -1;
return this!.where(predicate).length;
}