filter method

Map<K, V> filter(
  1. bool predicate(
    1. K key,
    2. V value
    )
)

Returns a new map with entries satisfying predicate.

Implementation

Map<K, V> filter(bool Function(K key, V value) predicate) =>
    Map.fromEntries(entries.where((e) => predicate(e.key, e.value)));