groupByKey method Null safety

Map<K, List<V>> groupByKey()

Implementation

Map<K, List<V>> groupByKey() {
  Map<K, List<V>> results = {};
  this.forEach((e) {
    results.putIfAbsent(e.key, () => <V>[]).add(e.value);
  });
  return results;
}