You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when a new fetched page length is bigger than pageSize an exception is thrown and the list never gets populated even when the data fetch was success. This is a rare situation but possible in case for example that the API endpoint you are requesting doesn't implement pagination and returns all data in each request.
This is the code currently:
If (length > this.pageSize) {
_isFetchingNotifier.value = false;
throw ('Page length ($length) is greater than the maximum size (${this.pageSize})');
}
I agree the new page length can not be bigger than the expected page size, but that doesn't mean the list can't be populated with the fetched data. The list should be populated with the data fetched and hasMoreItems should be set as false to avoid further pagination.
Something like this:
if (length > this.pageSize) {
this._hasMoreItems = false;
FlutterError.dumpErrorToConsole(
FlutterErrorDetails(exception: Exception(
'''
Inconsistent page length and page size.
Page length ($length) is greater than the maximum size (${this.pageSize}).
This is not allowed in pagination and therefore pagination will stop inmediately
''')), forceReport: true
);
// throw ('Page length ($length) is greater than the maximum size (${this.pageSize})');
}
The text was updated successfully, but these errors were encountered:
hey @luis901101
implemented the lirbary yesterday - got the same annoying error.
do you have any hot fix for that ?
if not i'll have to write my own pagination logic.
thanks in advance!
Currently when a new fetched page length is bigger than pageSize an exception is thrown and the list never gets populated even when the data fetch was success. This is a rare situation but possible in case for example that the API endpoint you are requesting doesn't implement pagination and returns all data in each request.
This is the code currently:
I agree the new page length can not be bigger than the expected page size, but that doesn't mean the list can't be populated with the fetched data. The list should be populated with the data fetched and hasMoreItems should be set as false to avoid further pagination.
Something like this:
The text was updated successfully, but these errors were encountered: