keyBy function

Map keyBy(
  1. List list,
  2. dynamic iteratee
)

Implementation

Map<dynamic, dynamic> keyBy(List list, dynamic iteratee) {
  return reduce(list, (Map<dynamic, dynamic> result, dynamic value, int index) {
    final key = evaluatePredicateKey(iteratee, value);
    result[key] = value;
    return result;
  }, {});
}