listMatchesAny<T> function

bool listMatchesAny<T>(
  1. Iterable<T>? list,
  2. bool matcher(
    1. T entry
    )
)

Returns true if any element of list matches matcher.

Implementation

bool listMatchesAny<T>(Iterable<T>? list, bool Function(T entry) matcher) {
  if (list == null || list.isEmpty) return false;
  for (var e in list) {
    if (matcher(e)) return true;
  }
  return false;
}