sortRows<T> function
Returns a new list of rows ordered by sorts, preserving the original
order of rows that compare equal.
Implementation
List<T> sortRows<T>(
List<T> rows,
List<SortSpec> sorts,
Map<String, GridColumn<T>> columns,
) {
final order = sortOrder<T>(rows, sorts, columns);
return [for (final i in order) rows[i]];
}