mapValues<T> method

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

Returns a new map where the value of every entry in this map is transformed by the given convert function.

The new Map preserves the entry iteration order of the this Map.

Implementation

Map<K, T> mapValues<T>(T Function(K key, V value) convert) {
  return map((key, value) => MapEntry(key, convert(key, value)));
}