diff --git a/lib/ui/app/tables/app_paginated_data_table.dart b/lib/ui/app/tables/app_paginated_data_table.dart index 87b019fb8..18a4110ac 100644 --- a/lib/ui/app/tables/app_paginated_data_table.dart +++ b/lib/ui/app/tables/app_paginated_data_table.dart @@ -322,8 +322,10 @@ class AppPaginatedDataTableState extends State { haveProgressIndicator = true; } } - row ??= _getBlankRowFor(index); - result.add(row); + if (row != null) { + row ??= _getBlankRowFor(index); + result.add(row); + } } return result; } @@ -378,6 +380,8 @@ class AppPaginatedDataTableState extends State { // FOOTER final TextStyle footerTextStyle = themeData.textTheme.bodySmall; final List footerWidgets = []; + final realRowCount = + widget.subtractOneFromCount ? _rowCount - 1 : _rowCount; if (widget.onRowsPerPageChanged != null) { final List availableRowsPerPage = widget.availableRowsPerPage //.where((int value) => value <= _rowCount || value == widget.rowsPerPage) @@ -387,6 +391,7 @@ class AppPaginatedDataTableState extends State { child: Text('$value'), ); }).toList(); + footerWidgets.addAll([ Container(width: 14.0), // to match trailing padding in case we overflow and end up scrolling @@ -413,9 +418,9 @@ class AppPaginatedDataTableState extends State { Container(width: 32.0), Text( localizations.pageRowsInfoTitle( - _firstRowIndex + 1, - _firstRowIndex + widget.rowsPerPage, - _rowCount - (widget.subtractOneFromCount ? 1 : 0), + realRowCount > 0 ? _firstRowIndex + 1 : 0, + _firstRowIndex + math.min(widget.rowsPerPage, realRowCount), + realRowCount, _rowCountApproximate, ), ),