firstValueWhereOrNull method
Iterates through all values of all sets, and returns the first value
it finds that satisfies test
.
If no element satisfies test
, the result of invoking the orElse
function is returned, or if orElse
is omitted, it returns null.
See also: firstValueWhere
Implementation
V? firstValueWhereOrNull(bool Function(V) test, {V? Function()? orElse}) {
for (ISet<V> values in _mapOfSets.values) {
V? value = values.firstWhereOrNull(test);
if (value != null) return value;
}
return orElse?.call();
}