paging_library icon indicating copy to clipboard operation
paging_library copied to clipboard

Allow the pageBuilder to provide the amount of total items

Open hacker1024 opened this issue 6 years ago • 1 comments

This should be possible so the loading widget isn't shown at the end of the list.

hacker1024 avatar Apr 23 '19 08:04 hacker1024

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: ...
);

hacker1024 avatar Apr 23 '19 08:04 hacker1024