Fix sorting reports by bool column

This commit is contained in:
Hillel Coren 2023-10-03 11:27:23 +03:00
parent fe3d22129b
commit 038e3a92a6
1 changed files with 8 additions and 0 deletions

View File

@ -1885,6 +1885,14 @@ int? sortReportTableRows(dynamic rowA, dynamic rowB,
final dynamic valueA = rowA[index].value;
final dynamic valueB = rowB[index].value;
if (valueA is bool) {
if (reportSettings.sortAscending) {
return valueA ? 1 : -1;
} else {
return valueA ? -1 : 1;
}
}
if (reportSettings.sortAscending) {
return valueA.compareTo(valueB);
} else {