associate<K, V> method
Returns a map that contains MapEntrys provided by a transform
function.
If two elements share the same key, the last one gets added to the map.
Example:
[1, 2, 3].associate((e) => MapEntry('key_$e', e * 100)); // {'key_1': 100, 'key_2': 200, 'key_3': 300}
Implementation
Map<K, V> associate<K, V>(MapEntry<K, V> Function(T element) transform) {
ArgumentError.checkNotNull(transform, 'transform');
return Map.fromEntries(map(transform));
}