W3cubDocs

/Dart 2

addAll method

void addAll (Map<K, V> other)
override

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

If a key of other is already in this map, its value is overwritten.

The operation is equivalent to doing this[key] = value for each key and associated value in other. It iterates over other, which must therefore not change during the iteration.

Implementation

void addAll(Map<K, V> other) {
  for (K key in other.keys) {
    this[key] = other[key];
  }
}

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