countWhere method

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

Implementation

int countWhere(bool Function(T element) test) {
  try {
    return where(test).length;
  } catch (_) {
    return 0;
  }
}