whereKey method

Map<K, V> whereKey(
  1. bool test(
    1. K k
    )
)

Returns a new map containing only the entries where the key satisfies the test predicate.

Example:

final filtered = map.whereKey((k) => k.startsWith('A'));

Implementation

Map<K, V> whereKey(bool Function(K k) test) =>
    Map.fromEntries(entries.where((e) => test(e.key)));