EdsonBueno / infinite_scroll_pagination

Flutter package to help you lazily load and display pages of items as the user scrolls down your screen.
https://pub.dev/packages/infinite_scroll_pagination
MIT License
612 stars 202 forks source link

Not able to scroll #239

Closed Mohammad-taqi1212 closed 1 year ago

Mohammad-taqi1212 commented 1 year ago

I applied this package but unable to scroll this listview. its showing first page only. Please help me to solve this issue. following are my code excample

Expanded(
                        child: FutureBuilder<UserPost>(
                          future: getUserPost(),
                          builder: (context, snapshot) {
                            if (snapshot.hasData) {
                              return ListView.builder(
itemCount: snapshot.data!.data!.length,
                                  itemBuilder: (context, i) {
return Padding(
                                        padding: EdgeInsets.only(left: 5, right: 5),
                                        child: PagedListView<int,dynamic>(
                                          shrinkWrap: true,
                                          pagingController: _pagingController,
                                          builderDelegate: PagedChildBuilderDelegate<dynamic>(
                                            itemBuilder: (context,item,index) =>
                                          Card()
)
}
)
clragon commented 1 year ago

your pagination is not working correctly because of shrinkWrap: true, which instructs it to build all items immediately. you should avoid shrinkwrapping your scrollviews.