FicComparatorExtension extension
The if0 extension
lets you nest comparators. For example:
// 1) Strings are ordered according to their length.
// 2) Otherwise, they come in their natural order.
compareTo = (String a, String b) =>
a.length.compareTo(b.length).if0(a.compareTo(b));
- on
Methods
-
if0(
int then) → int -
Available on int, provided by the FicComparatorExtension extension