MapBasics<K, V> extension

Utility extension methods for the native Map class.

on

Methods

get(K key, {V? defaultValue}) → V?
A type-checked version of operator [] that additionally supports returning a default value.
invert() Map<V, K>
Returns a new Map where each entry is inverted, with the key becoming the value and the value becoming the key.
whereKey(bool test(K)) Map<K, V>
Returns a new Map containing all the entries of this for which the key satisfies test.
whereValue(bool test(V)) Map<K, V>
Returns a new Map containing all the entries of this for which the value satisfies test.