Blank rows shown if there are not enough entries to display #492
This commit is contained in:
parent
7213eaf459
commit
07c075c14f
|
|
@ -322,9 +322,11 @@ class AppPaginatedDataTableState extends State<AppPaginatedDataTable> {
|
||||||
haveProgressIndicator = true;
|
haveProgressIndicator = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (row != null) {
|
||||||
row ??= _getBlankRowFor(index);
|
row ??= _getBlankRowFor(index);
|
||||||
result.add(row);
|
result.add(row);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -378,6 +380,8 @@ class AppPaginatedDataTableState extends State<AppPaginatedDataTable> {
|
||||||
// FOOTER
|
// FOOTER
|
||||||
final TextStyle footerTextStyle = themeData.textTheme.bodySmall;
|
final TextStyle footerTextStyle = themeData.textTheme.bodySmall;
|
||||||
final List<Widget> footerWidgets = <Widget>[];
|
final List<Widget> footerWidgets = <Widget>[];
|
||||||
|
final realRowCount =
|
||||||
|
widget.subtractOneFromCount ? _rowCount - 1 : _rowCount;
|
||||||
if (widget.onRowsPerPageChanged != null) {
|
if (widget.onRowsPerPageChanged != null) {
|
||||||
final List<Widget> availableRowsPerPage = widget.availableRowsPerPage
|
final List<Widget> availableRowsPerPage = widget.availableRowsPerPage
|
||||||
//.where((int value) => value <= _rowCount || value == widget.rowsPerPage)
|
//.where((int value) => value <= _rowCount || value == widget.rowsPerPage)
|
||||||
|
|
@ -387,6 +391,7 @@ class AppPaginatedDataTableState extends State<AppPaginatedDataTable> {
|
||||||
child: Text('$value'),
|
child: Text('$value'),
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
footerWidgets.addAll(<Widget>[
|
footerWidgets.addAll(<Widget>[
|
||||||
Container(width: 14.0),
|
Container(width: 14.0),
|
||||||
// to match trailing padding in case we overflow and end up scrolling
|
// to match trailing padding in case we overflow and end up scrolling
|
||||||
|
|
@ -413,9 +418,9 @@ class AppPaginatedDataTableState extends State<AppPaginatedDataTable> {
|
||||||
Container(width: 32.0),
|
Container(width: 32.0),
|
||||||
Text(
|
Text(
|
||||||
localizations.pageRowsInfoTitle(
|
localizations.pageRowsInfoTitle(
|
||||||
_firstRowIndex + 1,
|
realRowCount > 0 ? _firstRowIndex + 1 : 0,
|
||||||
_firstRowIndex + widget.rowsPerPage,
|
_firstRowIndex + math.min(widget.rowsPerPage, realRowCount),
|
||||||
_rowCount - (widget.subtractOneFromCount ? 1 : 0),
|
realRowCount,
|
||||||
_rowCountApproximate,
|
_rowCountApproximate,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue