compareBy<R> method Null safety

Comparator<R> compareBy<R>(
  1. T keyOf(
    1. R
    )
)

Makes a comparator on R values using this comparator.

Compares R values by comparing their keyOf value using this comparator.

Implementation

Comparator<R> compareBy<R>(T Function(R) keyOf) =>
    (R a, R b) => this(keyOf(a), keyOf(b));