compareTo method

int compareTo(
  1. T? other
)

Implementation

int compareTo(T? other){
  T? self = this;
  if(self == null && other == null) {
    return 0;
  } else if (self != null && other != null) {
    return self.compareTo(other);
  } else if (self == null) {
    return 1;
  } else {
    return -1;
  }
}