collections/multi_criteria_sort_utils library
Multi-criteria sort with weighted comparators — roadmap #462.
Functions
-
sortByCriteria<
T> (List< T> list, int compare(T a, T b)) → List<T> -
Returns a new list with
list's elements sorted bycompare. The originallistis not modified. -
thenBy<
T> (int primary(T, T), int thenByCompare(T, T)) → int Function(T, T) -
Builds a comparator that uses
primaryand thenthenByComparefor ties.