addEntries method

void addEntries (
  1. Iterable<MapEntry<K, V>> newEntries
)
override

Adds all key/value pairs of newEntries to this map.

If a key of newEntries is already in this map, the corresponding value is overwritten.

The operation is equivalent to doing this[entry.key] = entry.value for each MapEntry of the iterable.

Implementation

void addEntries(Iterable<MapEntry<K, V>> newEntries) {
  for (var entry in newEntries) {
    this[entry.key] = entry.value;
  }
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-collection/MapMixin/addEntries.html