aagarwal1012 / Liquid-Pull-To-Refresh

🔁 A custom refresh indicator for flutter.
https://pub.dev/packages/liquid_pull_to_refresh
MIT License
1.25k stars 92 forks source link

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

Closed JobMoll closed 5 years ago

JobMoll commented 5 years ago

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