compareTo dart code example Example: compareTo dart strings data.sort((a, b) { return compareAsciiUpperCase(a.name, b.name); });