Counts all elements for which where returns true
where
int count(bool Function(T) where) { var c = 0; for (final element in this) { if (where(element)) { ++c; } } return c; }