updateAll method
Updates all values in the map.
Calls update for each key-value pair and updates the value with
the returned result. Notifies subscribers after all updates.
Implementation
@override
void updateAll(V Function(K key, V value) update) {
bool needNotify = false;
for (var key in peek.keys) {
final oldValue = peek[key];
final newValue = peek[key] = update(key, oldValue as V);
if (!needNotify && oldValue != newValue) {
needNotify = true;
}
}
if (needNotify) {
notify();
}
}