thenByDescending method

Comparator<T> thenByDescending(
  1. Comparable selector(
    1. T
    )
)

Combines this Comparator and the given selector such that the latter is applied only when the former considered values equal. The provided selector is used for sorting in reverse.

myList.sort(compareBy((o) => o.firstProperty).thenByDescending((o) => o.secondProperty))

Implementation

Comparator<T> thenByDescending(Comparable Function(T) selector) {
  final thenComparator = compareByDescending(selector);
  return then(thenComparator);
}