collections/multi_key_group_utils library
Group and aggregate by several keys at once — roadmap #477.
Classes
- MultiKey
- A composite grouping key built from several selector values.
Functions
-
aggregateByKeys<
T, R> (Iterable< T> items, List<Object? Function(T)> keys, R aggregator(List<T> group)) → Map<MultiKey, R> -
Groups
itemsbykeysand reduces each bucket withaggregator, returning a map from composite key to the aggregate (e.g. a count, sum, or average per(country, year)). -
groupByKeys<
T> (Iterable< T> items, List<Object? Function(T)> keys) → Map<MultiKey, List< T> > -
Groups
itemsby applying every selector inkeys, bucketing rows whose composite key is equal. Returns a map from MultiKey to the list of items in that bucket, in first-seen insertion order.