compareTo static method

int compareTo(
  1. String? string,
  2. String? other, {
  3. bool nullIsLessThan = true,
})

Refer to Safe.compareTo

This method has special handling for a null string or other. If both are null then we return -1 If one of them is null then we use nullIsLessThan to determine if we return -1 or 1.

Implementation

static int compareTo(
  String? string,
  String? other, {
  bool nullIsLessThan = true,
}) => Safe.compareTo(string, other, nullIsLessThan: nullIsLessThan);