QuirijnGB / lazy-load-scrollview

A wrapper for a Flutter ScrollView which enables lazy loading
BSD 2-Clause "Simplified" License
108 stars 26 forks source link

can't add a RefreshIndicator as a parent to the listview.builder and child to LazyLoadScrollView #3

Closed devmuaz closed 4 years ago

devmuaz commented 4 years ago

Hey there, recently I've been working on this package.. and I tried to put my ListView.builder inside the LazyLoadScrollView, OK that's worked fine. BUT... when I tried to wrap my ListView.builder by RefreshIndicator it gives me an error and that because the child accepts only ScrollView Widget...

.
.
.
.
// rest of the code

            return LazyLoadScrollView(
              onEndOfPage: () {
                BlocProvider.of<FetchProductsBloc>(context).add(
                  FetchProducts(count: 20),
                );
              },
              child: ListView.builder(
                itemCount: state.count,
                itemBuilder: (context, index) {
                  return ListTile(
                    title: Text('Loaded Data $index'),
                  );
                },
              ),
            );
.
.
.
.

HOW can I wrap the (listview with lazy load scrollview) with a refresh indicator too?? Any solutions??

jinyus commented 4 years ago

I've also hit this roadblock, sucks that I will have to use another implementation of lazy load...I suggest you do the same because there hasn't been a commit in 6 months so the author is likely not maintaining this repo.

jinyus commented 4 years ago

Update: I found a solution in case you're still looking for one. Use this library instead: https://pub.dev/packages/lazy_load_refresh_indicator

It's pretty much the same thing with pull to refresh built in. Replace "LazyLoadScrollView" with "LazyLoadRefreshIndicator" and add the onRefresh parameter and you're good to go.

devmuaz commented 4 years ago

Thanks for replying.. It's been a while since I wrote this.. And I went back to RefreshIndicator which is built in Flutter... No need to add another package for your app since Flutter provides a lot of built-in widgets and things you need.. Unless you want something more beautiful..

Best regards