compareTo method
true > false Zero: This instance and value are equal (both true or both false). Greater than zero: This instance is true and value is false. Less than zero: This instance is false and value is true.
Implementation
int compareTo(bool other) => (this == other)
? 0
: this
? 1
: -1;