compareTo method

  1. @override
int compareTo(
  1. dynamic other
)
override

Orders wiki pages first.

Implementation

@override
int compareTo(other) {
  if (this is WikiTemplate) {
    if (other is WikiTemplate) {
      // both are wiki pages so compare names
      return this
          .destinationFilePath
          .path
          .compareTo(other.destinationFilePath.path);
    }
    // this is a wiki page and other is not a wiki page so this comes before
    return -1;
  } else {
    // this is not a wiki page so this comes after
    return 1;
  }
}