update method
- K key,
- V updater(
- V? value
Update value for key using function.
Implementation
void update(K key, V Function(V? value) updater) {
final newMap = Map<K, V>.from(val);
newMap[key] = updater(newMap[key]);
emit(newMap);
}
Update value for key using function.
void update(K key, V Function(V? value) updater) {
final newMap = Map<K, V>.from(val);
newMap[key] = updater(newMap[key]);
emit(newMap);
}