Correct report row count

This commit is contained in:
Hillel Coren 2023-02-23 14:32:52 +02:00
parent 0f4ff64e6a
commit a9393134b8
2 changed files with 5 additions and 1 deletions

View File

@ -72,6 +72,7 @@ class AppPaginatedDataTable extends StatefulWidget {
this.initialFirstRowIndex = 0,
this.onPageChanged,
this.rowsPerPage = defaultRowsPerPage,
this.subtractOneFromCount = false,
this.availableRowsPerPage = const <int>[
defaultRowsPerPage,
defaultRowsPerPage * 2,
@ -214,6 +215,8 @@ class AppPaginatedDataTable extends StatefulWidget {
/// {@macro flutter.widgets.scrollable.dragStartBehavior}
final DragStartBehavior dragStartBehavior;
final bool subtractOneFromCount;
@override
AppPaginatedDataTableState createState() => AppPaginatedDataTableState();
}
@ -410,7 +413,7 @@ class AppPaginatedDataTableState extends State<AppPaginatedDataTable> {
localizations.pageRowsInfoTitle(
_firstRowIndex + 1,
_firstRowIndex + widget.rowsPerPage,
_rowCount,
_rowCount - (widget.subtractOneFromCount ? 1 : 0),
_rowCountApproximate,
),
),

View File

@ -677,6 +677,7 @@ class _ReportDataTableState extends State<ReportDataTable> {
padding: const EdgeInsets.all(12),
child: AppPaginatedDataTable(
//showFirstLastButtons: true,
subtractOneFromCount: true,
header: SizedBox(),
sortColumnIndex: sortedColumns.contains(reportSettings.sortColumn)
? sortedColumns.indexOf(reportSettings.sortColumn)