Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

插件有属性设置滚动到底部自动加载更多吗 #769

Open
xshiwei opened this issue Oct 11, 2023 · 17 comments
Open

插件有属性设置滚动到底部自动加载更多吗 #769

xshiwei opened this issue Oct 11, 2023 · 17 comments

Comments

@xshiwei
Copy link

xshiwei commented Oct 11, 2023

No description provided.

@xshiwei
Copy link
Author

xshiwei commented Oct 11, 2023

我想实现用户滑动到底部自动加载更多,在web上也是如此。当滚动到list最大距离时自动加载更多,项目有属性能实现这个效果吗

@xuelongqy
Copy link
Owner

自带就有,infiniteOffset不为null即可。但是Web不支持

@xshiwei
Copy link
Author

xshiwei commented Oct 13, 2023

Web理论上也应该可以吧,鼠标滚轮滚动的时候,检测list到底部的时候自动加载更多

@xuelongqy
Copy link
Owner

Web理论上也应该可以吧,鼠标滚轮滚动的时候,检测list到底部的时候自动加载更多

不支持,在Flutter中,滚轮不能越界

@xshiwei
Copy link
Author

xshiwei commented Oct 18, 2023

_controller.addListener(() { if (_controller.position.atEdge) { bool isTop = _controller.position.pixels == 0; if (isTop) { debugPrint('At the top'); } else { debugPrint('At the bottom'); onLoadMore(); } } });

@xshiwei
Copy link
Author

xshiwei commented Oct 18, 2023

_controller.addListener(() { if (_controller.position.atEdge) { bool isTop = _controller.position.pixels == 0; if (isTop) { debugPrint('At the top'); } else { debugPrint('At the bottom'); onLoadMore(); } } });

这个方式可以吗,判断列表到底部了则自动加载更多

@xuelongqy
Copy link
Owner

你可以试试设置Footer中的infiniteOffset,这个是距离底部多少,触发加载。但是Web中使用滚轮始终不能显示Footer

@xshiwei
Copy link
Author

xshiwei commented Oct 18, 2023

infiniteOffset 这个偏移量在web上即使设置为0也无效,是因为web上在到底部了无法进行偏移操作对吧。 我的想法是在无限滚动的逻辑那里,针对web进行特殊的处理,只判断position是否到底部。

@xshiwei
Copy link
Author

xshiwei commented Oct 18, 2023

image

@xshiwei
Copy link
Author

xshiwei commented Oct 18, 2023

不知是否可行

@xuelongqy
Copy link
Owner

不知是否可行

设置infiniteOffset为正数,你可以试试看

@xshiwei
Copy link
Author

xshiwei commented Oct 18, 2023

不行,设置了10,但是到底部后无法再触发滚动了。

@xshiwei
Copy link
Author

xshiwei commented Oct 18, 2023

我和flutter官方提过这个issue的,不过他们似乎不认为这个是一个待解决的问题

@xuelongqy
Copy link
Owner

我和flutter官方提过这个issue的,不过他们似乎不认为这个是一个待解决的问题

是的,所以受限Flutter官方的做法。目前还没找到其他解决办法

@xshiwei
Copy link
Author

xshiwei commented Oct 18, 2023

_controller.addListener(() { if (_controller.position.atEdge) { bool isTop = _controller.position.pixels == 0; if (isTop) { debugPrint('At the top'); } else { debugPrint('At the bottom'); onLoadMore(); } } });

这个代码我在web测试过了,是可以到底部位置自动加载更多的。 不知道在咱们这个项目里能否作为web端的暂时的处理方式。毕竟鼠标下拉才加载更多在web上体验太不友好了。

@xshiwei
Copy link
Author

xshiwei commented Oct 18, 2023

可能两者思想不兼容,footer改动会很大,那还是不太方便。

@FZY456
Copy link

FZY456 commented Feb 4, 2024

Web理论上也应该可以吧,鼠标滚轮滚动的时候,检测list到底部的时候自动加载更多

不支持,在Flutter中,滚轮不能越界

flutter_easy_refresh 2.x版本,在windows端,滚轮使得列表滚到底部,会触发加载下一页。easy_refresh 3.3.4 在windows端,滚轮滚动到列表底部,也触发不了加载下一页。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants