Comments (5)
hi @nandakista
I think this happens because a ListView doesn't provide its complete dimensions all at once. Instead, it only renders the elements that are currently visible.
On the other hand, when using SingleChildScrollView with Column, the entire item list is mounted and painted, even if only a few items are visible. The widget has defined dimensions, and that appears to be what the parameter wants.
If you want to know more about it, take a look at this StackOverflow discussion.
from infinite_scroll_pagination.
Hi @caiombueno
Thank you for the response and the explanation.
I tried building using a ListView without a builder like the code below
/// Still not work
...
firstPageProgressIndicatorBuilder: (context) {
return ListView(
children: [
for (var i = 0; i < 20; i++)
Text('[Sample] Loading shimmer item-$i'),
],
);
}
...
But having the same error, isn't it true that if use a ListView without a builder it will also build all the widgets not just the visible ones (constructor ListView #1) ?
So for this problem, am I required to use SingleChildScrollView for the shimmer list? That's a kinda weird
from infinite_scroll_pagination.
As far as I understand, the default ListView doesn't build and render the whole list at once; instead, it creates the entire list in memory at once. I took this information from Ala Amarneh's answer in this discussion.
If you really want to use the ListView, you could wrap it in a SizedBox.
from infinite_scroll_pagination.
Had same issue, had to use column like that to mimic ListView.separated
Column( children: List.generate( 20, (index) => index.isEven ? shimmerWidget : const SizedBox(height: 8.0)))
from infinite_scroll_pagination.
Elegant solution : wrap your listview inside firstPageProgressIndicatorBuilder with a Sizedbox.shrink.
from infinite_scroll_pagination.
Related Issues (20)
- pagedpageview can't scroll in desktop web HOT 2
- [Question] Animating Items in PagedListView on Add/Remove HOT 1
- [Question] Disable Automatic Next Page Load HOT 2
- No items fetched after fetching less than invisibleItemsThreshold items HOT 5
- GetX Controller not working
- How to handle item deletion? HOT 1
- _pagingController dispose issue when used inside a BLoC HOT 2
- [Feature Request]: Auto scroll/slide PagedPageView children HOT 1
- Infinite Staggered View HOT 2
- How can i do offline search/filter? HOT 2
- Using this package with nestedscrollview/tab bars causes issue with scrolling HOT 3
- Expose ScrollBehavior
- Plans for new release HOT 2
- Example beer API seems to be not available anymore HOT 2
- Is it possible to insert a new item with animation? HOT 1
- how to remove an item HOT 1
- How to retain scroll position after forcing a controll refresh? HOT 1
- Prepend functionality
- Flutter 3.22 support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infinite_scroll_pagination.