groupAndRemapBy<M, V> method

Map<M, V> groupAndRemapBy<M, V>(
  1. M keyFunction(
    1. T
    ),
  2. V valueFunction(
    1. List<T>
    )
)

Groups the items in the list by the item returned by the lambda function and remaps the values.

The lambda function takes an item of type T and returns a item of type M used as key. The function returns a Map<M,V> where each key is a item of type M returned by the lambda function and each value is a List that have that key remmaped as V.

Implementation

Map<M, V> groupAndRemapBy<M, V>(M Function(T) keyFunction, V Function(List<T>) valueFunction) => groupAndMapBy(keyFunction).map((key, value) => MapEntry(key, valueFunction(value)));