compareTo method

int compareTo(
  1. bool other
)

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;