groupBy<K, V> function
Implementation
Map<K, List<V>> groupBy<K, V>(List<V> values, K mappedBy(V item)) {
final result = <K, List<V>>{};
values.forEach((v) {
final key = mappedBy(v);
if (!result.containsKey(key)) {
result[key] = <V>[];
}
result[key]!.add(v);
});
return result;
}