📜  检查滚动位置是在 ListView 的顶部还是底部? - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:40.061000             🧑  作者: Mango

代码示例1
_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
            }
        }
    );