mapValues<V2> method

Map<K, V2> mapValues<V2>(
  1. V2 transform(
    1. K key,
    2. V value
    )
)

Returns a new map with transformed values.

Implementation

Map<K, V2> mapValues<V2>(V2 Function(K key, V value) transform) {
  final output = <K, V2>{};
  forEach((key, value) {
    output[key] = transform(key, value);
  });
  return output;
}