addAll method

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

Adds all key-value pairs from the given map to this map.

All entries from other are added to this map, overwriting any existing entries with the same keys. Notifies subscribers after update.

Implementation

@override
void addAll(Map<K, V> other) {
  bool needNotify = false;
  other.forEach((key, value) {
    if (!needNotify && (!peek.containsKey(key) || peek[key] != value)) {
      needNotify = true;
    }
    peek[key] = value;
  });

  if (needNotify) {
    notify(true);
  }
}