filterMap<K, V> function
Filters key-value pairs in a Map
map Source map
predicate Filter condition function
Implementation
Map<K, V> filterMap<K, V>(
Map<K, V> map,
bool Function(K key, V value) predicate,
) {
return Map.fromEntries(
map.entries.where(
(entry) => predicate(entry.key, entry.value),
),
);
}