aagarwal1012/Liquid-Pull-To-Refresh

_scrollController.position.pixels doesn't work when ListView in widget LiquidPullToRefresh

JobMoll opened this issue · 0 comments

Describe the bug
I am trying to let the list load more when the end is reached using

_scrollController.addListener(
  () {
    print(_scrollController.position.pixels);
    if (_scrollController.position.pixels ==
        _scrollController.position.maxScrollExtent) {
      _nextPage();
    }
  },
);

but when the Listview is wrapped inside a LiquidPullToRefresh is doesn't return the value.

To Reproduce
Steps to reproduce the behavior:

  1. Use this code:

ScrollController _scrollController = new ScrollController();

@OverRide
void initState() {
super.initState();
_nextPage();

_scrollController.addListener(
  () {
    print(_scrollController.position.pixels);
    if (_scrollController.position.pixels ==
        _scrollController.position.maxScrollExtent) {
      _nextPage();
    }
  },
);

}

and add the
child: ListView.builder(
controller: _scrollController,

Scroll to the bottom and nothing happens. When you take away the LiquidPullToRefresh it does return the value.

Expected behavior
That the controller of the Listview gives the position.pixels