groupBy<K> method
Group by method for Lists. Example usage: List list.groupBy((a) => a.date);
Implementation
Map<K, List<E>> groupBy<K>(K Function(E) keyFunction) => fold(
<K, List<E>>{},
(Map<K, List<E>> map, E element) =>
map..putIfAbsent(keyFunction(element), () => <E>[]).add(element),
);