updateAll method

  1. @override
void updateAll(
  1. String update(
    1. String key,
    2. String value
    )
)

Updates all values.

Iterates over all entries in the map and updates them with the result of invoking update.

final terrestrial = <int, String>{1: 'Mercury', 2: 'Venus', 3: 'Earth'};
terrestrial.updateAll((key, value) => value.toUpperCase());
print(terrestrial); // {1: MERCURY, 2: VENUS, 3: EARTH}

Implementation

@override
void updateAll(String Function(String key, String value) update) {
  for (var entry in entries.toList()) {
    this[entry.key] = update(entry.key, entry.value);
  }
}