mergeWith method

Map<K, List<V>> mergeWith(
  1. Map<K, List<V>?>? other
)

Implementation

Map<K, List<V>> mergeWith(Map<K, List<V>?>? other) {
  final newMap = <K, List<V>>{...?this};
  other?.forEach((key, valueList) {
    newMap.putIfAbsent(key, () => <V>[]).addAll([...?valueList]);
  });
  return newMap;
}