associateWith<V> method

Map<E, V> associateWith<V>(
  1. V valueSelector(
    1. E element
    )
)

Returns a Map where keys are elements from the given collection and values are produced by the valueSelector function applied to each element.

Implementation

Map<E, V> associateWith<V>(V Function(E element) valueSelector) =>
    Map.fromIterables(this, map(valueSelector));