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