GridSheetSorter class
Default sorting logic for GridSheet columns.
This class provides the built-in comparison logic used when no custom comparator is registered for a column. It handles common data types with sensible defaults.
Comparison Rules
- Null Values: Always sorted last (after non-null values)
- Numbers: Natural numeric comparison (
1 < 2 < 10) - Dates: Chronological order (earliest to latest)
- Strings: Case-insensitive alphabetical order
- Other Types: Converted to strings and compared alphabetically
Usage
The default comparator is used automatically. You can also call it directly for custom sorting logic:
final result = GridSheetSorter.defaultCompare('apple', 'Banana');
// result < 0 because 'apple' comes before 'banana' (case-insensitive)
See also:
- GridSheetValueComparator, for custom comparison logic
GridSheetStateManager.setColumnComparator, to override defaults
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
defaultCompare(
dynamic a, dynamic b) → int - Compares two values using default sorting rules.