paging_library
paging_library copied to clipboard
Allow the pageBuilder to provide the amount of total items
This should be possible so the loading widget isn't shown at the end of the list.
At the moment, the following workaround is an option:
int _totalItems;
...
Pagination<Data>(
pageBuilder: (currentSize) async {
if (currentSize == _totalItems) return const [];
final data = await getData(currentSize);
_totalItems = data.totalItems;
return data;
},
itemBuilder: ...
);