Do we really want StreamBuilder at the first place?
Seems it only needed to make sure the AggregateQueryBuilder will return the right number of rows, if the data is changing on the query side....but this defeat the intent of limiting the data retrieved, we even make an extra query when we can use the docs.lenght to update the PaginatedDataTable bottom navigation information.
I think the we need to pass to the FirestoreQueryBuilder to limit the snapshot to the number of rows we have in the page => pageSize: widget.rowsPerPage, otherwise if you allow the checkbox and select all items on the page (with let say 10 rows) you will get 20 item selected !!!
With the addition of the _aggregateSnapshot I think the override of : bool get isRowCountApproximate => _aggregateSnapshot?.count == null || (_previousSnapshot!.isFetching || _previousSnapshot!.hasMore);
maybe not right, because the intent of having AggregateQueryBuilder seems to have the exact number of rows, so the isRowCountApproximate can be always false. But we can argue the query can send more rows the next time tap on the next page...
Bug report
Describe the bug After the code(bellow) the first item is more an discussion than a bub, but the point 2 and 3 seems to be bugs.
Couple os things:
Do we really want StreamBuilder at the first place? Seems it only needed to make sure the AggregateQueryBuilder will return the right number of rows, if the data is changing on the query side....but this defeat the intent of limiting the data retrieved, we even make an extra query when we can use the docs.lenght to update the PaginatedDataTable bottom navigation information.
I think the we need to pass to the FirestoreQueryBuilder to limit the snapshot to the number of rows we have in the page =>
pageSize: widget.rowsPerPage,
otherwise if you allow the checkbox and select all items on the page (with let say 10 rows) you will get 20 item selected !!!With the addition of the _aggregateSnapshot I think the override of :
bool get isRowCountApproximate => _aggregateSnapshot?.count == null || (_previousSnapshot!.isFetching || _previousSnapshot!.hasMore);
maybe not right, because the intent of having AggregateQueryBuilder seems to have the exact number of rows, so the isRowCountApproximate can be always false. But we can argue the query can send more rows the next time tap on the next page...