compareTo method Null safety

int? compareTo(
  1. String other
)

Implementation

int? compareTo(String other) {
  return value?.compareTo(other);
}