foldedCompare function
Comparator-shaped free function for List.sort, SplayTreeMap, and other
sort-key APIs, since tearing an extension method off into a
Comparator<String?> is awkward. Delegates to
StringFoldedCompareExtensions.compareStringFolded.
Example:
names.sort(foldedCompare);
SplayTreeMap<String, int>(foldedCompare);
Audited: 2026-06-12 11:26 EDT
Implementation
@useResult
int foldedCompare(
String? a,
String? b, {
bool caseSensitive = false,
bool nullsLast = false,
bool natural = false,
}) => a.compareStringFolded(
b,
caseSensitive: caseSensitive,
nullsLast: nullsLast,
natural: natural,
);