Home > other >  how can I detect the scroll option is not active for listview?
how can I detect the scroll option is not active for listview?

Time:06-03

I am trying to write a scroll pagination widget but What I am stuck some point due scroll controller. I am listening a scroll controller, if user scrolled the list to end of the listview I am sending a page request but it is not working because if first request response widgets height lesser than the view height, user can't scroll so scroll controller listener never triggering. For this problem, my question is how can I detect the scrolling is active or not ? (what I want is, if loaded page results widgets smaller than the list view height, send a new page request.)

CodePudding user response:

you can apAlwaysScrollableScrollPhysics() to your gridview and it will always let the user scroll even if it has less height.

documentation: https://api.flutter.dev/flutter/widgets/AlwaysScrollableScrollPhysics-class.html

CodePudding user response:

Ruchit's answer is a good option, Or you could get the height of the widget and compare it to the screen height. That should work.

How to get the widget's height: How to get height of a Widget?

  • Related