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
626 stars 213 forks source link

Unable to set height for noMoreItemsIndicatorBuilder widget #269

Closed rasikhq closed 1 year ago

rasikhq commented 1 year ago

I'm having trouble setting the height for the widget displayed when no more items are available, I tried setting the padding to zero, shrinkWrap to true and setting a SizedBox parent but none seem to do anything, what am I doing wrong?

@override
  Widget build(BuildContext context) {
    return Obx(() => RefreshIndicator(
          onRefresh: () => Future.sync(
            () => _pagingController.refresh(),
          ),
          child: PagedGridView(
              shrinkWrap: true,
              padding: EdgeInsets.zero,
              pagingController: _pagingController,
              builderDelegate: PagedChildBuilderDelegate<Ad>(
                  itemBuilder: (context, item, index) => AdItem(
                      ad: item, mini: g_ListStyle.value == ListStyle.cell),

                  // Handle no more items widget
                  noMoreItemsIndicatorBuilder: (_) =>
                      SizedBox(height: 10, child: Placeholder())),
                  // --- \\

              gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                crossAxisCount: g_ListStyle.value == ListStyle.card ? 1 : 2,
              )),
        ));
  }
Screenshot ![image](https://github.com/EdsonBueno/infinite_scroll_pagination/assets/16344370/9dddbdcf-f18b-4ac8-ba44-0656129c8a58)
hrznx commented 1 year ago

Hello DizzasTeR are u still alive haha?

EdsonBueno commented 1 year ago

@DizzasTeR set the showNoMoreItemsIndicatorAsGridChild property of your PagedGridView to false. Feel free to reopen the issue if this doesn't solve the issue.