group<K> method
Implementation
Map<K, List<T>> group<K>(K by(T item)) {
final map = <K, List<T>>{};
this.forEach((value) {
final key = by(value);
if (map.containsKey(key)) {
map[key]!.add(value);
} else {
map[key] = <T>[value];
}
});
return map;
}