mapValues<V2> method

Map<K1, V2> mapValues<V2>(
  1. V2 mapper(
    1. V1 value
    )
)

Returns a new map with the same keys and new values.

Implementation

Map<K1, V2> mapValues<V2>(V2 Function(V1 value) mapper) {
  return Map.fromEntries(
    entries.map(
      (e) => MapEntry(
        e.key,
        mapper(e.value),
      ),
    ),
  );
}