toMap<K> method
Creates a map from this Iterable using it's value as map values and
results of getKey as keys.
The code is:
{
for (final value in this)
getKey(value): value,
}
Implementation
Map<K, E> toMap<K>(K Function(E) getKey) {
return {
for (final value in this) getKey(value): value,
};
}