thenBy method

Comparator<T> thenBy(
  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.

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

Implementation

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