all method

bool all(
  1. bool test(
    1. K key,
    2. V value
    )
)

Returns true if all entries satisfy test, or this Map is empty.

Implementation

bool all(bool Function(K key, V value) test) {
  if (isEmpty) return true;

  for (final MapEntry(:key, :value) in entries) {
    if (!test(key, value)) return false;
  }

  return true;
}