BoolSortingHelper extension

Saropa sorting extension for a single bool.

bool does not implement Comparable in dart:core, so [true, false] .sort() throws and there is no canonical way to order booleans. This extension adds a Comparable.compareTo-shaped comparator so a bool can be used directly as a sort key or as a tie-break inside a larger comparator.

on

Methods

compareTo(bool other) int

Available on bool, provided by the BoolSortingHelper extension

Compares this boolean to other, following the Comparable.compareTo contract so booleans can be used as a sort key.