filterValues<K, V> function Null safety

Map<K, V> filterValues<K, V>(
  1. Map<K, V> source,
  2. bool filter(
    1. V value
    )
)

Implementation

Map<K, V> filterValues<K, V>(Map<K, V> source, bool filter(V value)) =>
    source.entries
        .where((e) => filter(e.value))
        .toList()
        .asMap()
        .map((_, e) => e);