thenDescending method

Comparator<T> thenDescending(
  1. Comparator<T> comparator
)

Combines this Comparator and the given comparator such that the latter is applied only when the former considered values equal. The provided comparator is applied in reverse order.

myList.sort(compareBy((o) => o.firstProperty).thenDescending(naturalOrder))

Implementation

Comparator<T> thenDescending(Comparator<T> comparator) {
  return then(reverse(comparator));
}