馃悰 All data is loaded at once when using StreamBuilder inside the itemBuilder #215
Closed
1 task done
Labels
resolution: duplicate
This issue or pull request already exists
Is there an existing issue for this?
What plugin is this bug for?
Firebase UI Database
What platform(s) does this bug affect?
Android, iOS
List of dependencies used.
flutter pub deps -s list
dev dependencies:
transitive dependencies:
Steps to reproduce
I have 4 items in the ENTRIES table. I am trying to download them pageSize at a time (ie, before the user scrolls).
As I set pageSize=2, only 2 should be loaded.
Instead, all 4 are loaded, as verified by printing the value of index when the widget in itemBuilder finishes loading.
My theory is that this undesired behavior happens because I am calling a secondary StreamBuilder inside the itemBuilder. I need to call it in order to look up the item-associated data at another database location.
In general, the query parameter doesn't seem to be doing a listen(), only a once() or get(). How to accommodate the case when a listen() is needed?
Here's the code:
Expected Behavior
I have 4 items in the ENTRIES table. I am trying to download them pageSize at a time (ie, before the user scrolls).
As I list pageSize=2, only 2 should be loaded.
Actual Behavior
Instead, all 4 are loaded, as verified by printing the value of index when the widget in itemBuilder finishes loading.
Additional Information
For testing I've made the items artificially tall (almost as high as the screen) just to make sure that scrolling would be required to load items 3 and 4.
The text was updated successfully, but these errors were encountered: