Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request - Add a event when the scroll meet the bottom #17

Open
JoHwanhee opened this issue Mar 14, 2020 · 3 comments
Open

Request - Add a event when the scroll meet the bottom #17

JoHwanhee opened this issue Mar 14, 2020 · 3 comments

Comments

@JoHwanhee
Copy link

a small request,, for pagination.
need a event when the scroll meet the bottom..

@ThomasEcalle
Copy link
Contributor

Hi @JoHwanhee
First of all, I am sorry for the delay.
The situation in my company (in France) with the Covid-19 has forced us to put our open source projects on the side for a moment... But I am back ! :)

I could give user access to such callback but I am not sure about the logic of pagination after.
Indeed, the entire ListView will be built again with new values but you will loose previous one, no ?

I think that pagination is a great topic and I would like to work on it for the flappy_search_bar but I think that would deserve a lot more work to be enable to keep last search in memory and concat with new one.

Don't you agree ?
I am not sure to be clear enough, sorry for my english :)

I'll try to be more present on this package, despite the difficult context that had lead us to change a lot the way we work here, sorry again for the delay :)

@JoHwanhee
Copy link
Author

I really thank you for your reply. are you ok about Covid-19?

So you means, it is hard to work because to concat last data with new one?

I'm not sure why you're worried about keeping data in memory, i think no problem for memory. it is the issue about the user that use this Lib.

@sagreine
Copy link

sagreine commented Dec 28, 2020

You could capture it indirectly by wrapping SearchBar with something like this, coupled with pagination.
more here: #40 (comment)
just a novice on my end :)


NotificationListener<ScrollNotification>(
                onNotification: (notification) {
                  // if we're searching and have hit the bottom index.
                  if (search != "") {
                    if (notification.metrics.atEdge) {
                      if (notification.metrics.pixels != 0) {
                        var temp = _videos.length;
                        print(
                            "number of search results before getting next page: ${_videos.length}");
                        getDocumentsNext(context, search).then((value) {
                          print(
                              "number of search results after getting next page: ${_videos.length}");
                          if (temp != _videos.length) {
                            // we've updated the source we're pulling from, so the same search will give more data
                            _searchBarController.replayLastSearch();
                          }
                        });
                      }
                    }
                  }
                  return true;
                },
 child: SearchBar<ExerciseSet>(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants