revalue<V1> method

  1. @useResult
Map<K, V1> revalue<V1>(
  1. V1 convert(
    1. V value
    )
)

Returns a copy of this map with its values transformed using convert.

final foo = {1: 1, 2: 2};
final bar = foo.revalue((v) => '$v'); // {1: '1', 2: '2'}

See rekey for converting values and map for converting entries.

Implementation

@useResult
Map<K, V1> revalue<V1>(V1 Function(V value) convert) => {
  for (final MapEntry(:key, :value) in entries)
    key: convert(value),
};