flip<K, V> static method
Swaps keys ↔ values. When values collide, the last entry wins.
Obj.flip({'one': 1, 'two': 2}); // {1: 'one', 2: 'two'}
Implementation
static Map<V, K> flip<K, V>(Map<K, V> map) => {
for (final e in map.entries) e.value: e.key,
};