listMatchesAll<T> function

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

Returns true if all list elements matches matcher.

Implementation

bool listMatchesAll<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 false;
  }
  return true;
}