count method

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

Returns the number of elements matching the given test predicate.

Implementation

int count(bool Function(T element) test) => where(test).length;