比较两个字符串是否相同,返回 -1/0/1。
int compare(String? other) { final s = this; if (s == null || other == null) { return s == null ? -1 : 1; } if (s == other) { return 0; } return s.compareTo(other); }