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

Infinite scroll calls backend infinitely even when list view is not scrolled #315

Closed
corrantho opened this issue Jan 3, 2023 · 1 comment
Assignees
Labels
closed: not a bug The behavior is correct/expected.

Comments

@corrantho
Copy link

Issue tracker is ONLY used for reporting bugs. New feature suggestions and questions should be discussed on Community or submitted through our user feedback form.

Your issue may already be reported! Please search in the issue tracker before creating one.

Please thumbs up this issue if you have also experienced it. You may also add more information if there is something relevant that was not mentioned. However, please refrain from comments that are not constructive, like "I have this problem too", etc.

Expected behavior (required)

A list view has been configured to retrieve data from a backend API.
When infinite scroll is disabled, only one call to the backend API is made.
When infinite scroll is enabled, we should have several calls to the backend API when we scroll the list view and reach the end of the list view.

Current behavior (required)

When infinite scroll is enabled, we can see infinite numbers of calls to the backend API, even if the list view is not scrolled.

We can see in the chrome dev tools > Network, all the calls to the backend API. We can see the page number is also increased (expected behaviour but when we scroll the list view).

To Reproduce (required)

https://app.flutterflow.io/project/infinite-scroll-test-lx5wrv

Steps to reproduce the behavior:

  1. Open the project
  2. Run test mode
  3. Go the Network dev tools and see the multiple calls

Your environment

  • Version of FlutterFlow used: 3.3.4
  • Platform (e.g. Web, MacOS Desktop): MacOS
  • Browser name and version: Chrome and Safari
  • Operating system and version (desktop or mobile): MacOS Ventura
@corrantho corrantho added the status: needs triage A potential issue that has not been confirmed as a bug. label Jan 3, 2023
@aemelyanovff
Copy link
Collaborator

It behaves this way because there's no limit on the height of the list view, so it tries to expand indefinitely.

Try this:

  • Wrap the ListView in a Container widget. Set some height, e.g. 300px.
  • Enable scrolling on the Column.

Then it should work - it'll load only one or two pages at first, and then load additional pages as you scroll.

@aemelyanovff aemelyanovff self-assigned this Jan 3, 2023
@aemelyanovff aemelyanovff added closed: not a bug The behavior is correct/expected. and removed status: needs triage A potential issue that has not been confirmed as a bug. labels Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: not a bug The behavior is correct/expected.
Projects
None yet
Development

No branches or pull requests

4 participants