toMap<K, V> method

Map<K, V> toMap<K, V>(
  1. K key(
    1. T
    ),
  2. V value(
    1. T
    )
)

Transforms this Iterable into map, using key and value to produce keys and values respectively.

Implementation

Map<K, V> toMap<K, V>(K Function(T) key, V Function(T) value) => {
  for (final element in this)
    key(element) : value(element)
};