int compare(
)

A Comparator that compares one comparable to another.

It returns the result of a.compareTo(b).

This utility function is used as the default comparator for ordering collections, for example in the List sort function.

Source

/**
 * A [Comparator] that compares one comparable to another.
 *
 * It returns the result of `a.compareTo(b)`.
 *
 * This utility function is used as the default comparator
 * for ordering collections, for example in the [List] sort function.
 */
static int compare(Comparable a, Comparable b) => a.compareTo(b);