groupBy method

Map<T, List<T>> groupBy(
  1. T fn(
    1. T
    )
)

Group by objects according to condition

Example:

list.groupBy(fn)

Implementation

Map<T, List<T>> groupBy(T Function(T) fn) => Map<T, List<T>>.fromIterable(
      map(fn).toSet(),
      value: (i) => where((T v) => fn(v) == i).toList(),
    );