Scroll to top of the feed

Is it possible to scroll to the top of the feed or end?

Could you specify which feed you are referring to? If possible, it would be helpful to share a screen recording so that I can better understand the problem and provide more accurate assistance.

I’m using the Feed as in your Flutter example
The following commands the refresh

                      amityPostController.reset();
                      amityPostController.fetchNextPage();

I used the same to go to the top and it is working

So it’s working when you scroll up to the top, but it doesn’t work when you scroll down to the bottom? is that correct?

I removed the option to scroll to end.
The way I use refresh the feed it’s more than scroll to to top

Do you have option to scroll to top without refresh?

In this case, we would recommend you to customize your frontend to enable scroll to top without calling our sdk.

1 Like

I see the the scroll to top using:

                      amityPostController.reset();
                      amityPostController.fetchNextPage();

go to top of page and not to top of all pages

Is it possible to go to top of all pages?

Could you please clarify what “all pages” refers to? If possible, providing a screenshot or recording would be greatly appreciated as it will help the team better comprehend this.

I found the problem
I removed the following condition

scrollcontroller.position.pixels > scrollcontroller.position.maxScrollExtent-800

  void pagination() async {
    if (scrollcontroller.position.pixels == scrollcontroller.position.maxScrollExtent)
        && amityPostController.hasMoreItems
        && !loadingNexPage
    ) {
      loadingNexPage = true;
      notifyListeners();
      await amityPostController.fetchNextPage().then((value) async {
        loadingNexPage = false;
        notifyListeners();
      });
    }
  }

  void gotoTop() async {
    amityPostController.init();
    amityPostController.fetchNextPage();
    notifyListeners();
  }
1 Like

Thanks for the update. Can I assume that your question has got answered?

Yes,
Thanks you,
Kobi

1 Like