rejectNot<K, V> method
Returns a new map with all entries that do not satisfy the given predicate
.
The entries in the resulting map do not
preserve the order of the original map.
Implementation
Map<K, V> rejectNot<K, V>(bool Function(K key, V value) predicate) {
final map = <K, V>{};
for (final key in keys) {
if (predicate(key as K, this[key] as V)) {
map[key] = this[key] as V;
}
}
return map;
}