Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the pageBuilder to provide the amount of total items #2

Open
hacker1024 opened this issue Apr 23, 2019 · 1 comment
Open

Allow the pageBuilder to provide the amount of total items #2

hacker1024 opened this issue Apr 23, 2019 · 1 comment

Comments

@hacker1024
Copy link

hacker1024 commented Apr 23, 2019

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

@hacker1024
Copy link
Author

hacker1024 commented Apr 23, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant