invertMap<K, V> static method
Inverts a map (swaps keys and values).
Example:
Helpers.invertMap({'a': 1, 'b': 2}); // {1: 'a', 2: 'b'}
Implementation
static Map<V, K> invertMap<K, V>(Map<K, V> map) =>
map.map((K key, V value) => MapEntry<V, K>(value, key));