mapWhere method
Returns an Iterable that replaces elements that do not satisfy predicate
with the new element returned by replace
.
Implementation
Iterable<T> mapWhere(bool Function(T) predicate, T Function(T) replace) sync* {
for (final element in this) {
if (predicate(element)) {
yield replace(element);
} else {
yield element;
}
}
}