toMap<TKey, TVal> method

Map<TKey, TVal> toMap<TKey, TVal>(
  1. GetValue<E, TKey> getKey,
  2. GetValue<E, TVal> getVal
)

Creates a Map instance from the iterable.

getKey used to get key for result Map. getVal used to get value for result Map.

Implementation

Map<TKey, TVal> toMap<TKey, TVal>(
        GetValue<E, TKey> getKey, GetValue<E, TVal> getVal) =>
    {for (final e in this) getKey(e): getVal(e)};