Answers for "Check if scroll position is at top or bottom in ListView?"

0

Check if scroll position is at top or bottom in ListView?

_scrollController = new ScrollController();

    _scrollController.addListener(
        () {
            double maxScroll = _scrollController.position.maxScrollExtent;
            double currentScroll = _scrollController.position.pixels;
            double delta = 200.0; // or something else..
            if ( maxScroll - currentScroll <= delta) { // whatever you determine here
                //.. load more
            }
        }
    );
Posted by: Guest on September-05-2021

Code answers related to "Check if scroll position is at top or bottom in ListView?"

Browse Popular Code Answers by Language