all method
Returns true
if all elements in the set satisfy the given predicate
.
Example:
final numbers = {2, 4, 6};
final allEven = numbers.all((n) => n.isEven); // true
Implementation
bool all(bool Function(E element) predicate) {
for (final element in this) {
if (!predicate(element)) return false;
}
return true;
}