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

列表只有一条数据并且Item高度小于触发加载的距离时,上拉加载无法触发。 #160

Closed
sf294383583 opened this issue Sep 9, 2019 · 4 comments

Comments

@sf294383583
Copy link

当列表只有一条数据并且Item高度小于触发加载的距离,上拉距离小于Item时加载footer上移出现,大于Item距离时footer会反向下移,松手后footer跳动且并未触发加载。

EasyRefresh.custom(
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(context, index) {
return Container(
height: 50,
alignment: Alignment.centerLeft,
color: Colors.blue,
child: Text('测试'),
);
},
childCount: 1,
),
),
],
onRefresh: () {},
onLoad: () {},
),

@WangPe1n
Copy link

我也遇到这个问题了,慢慢拖动松手不会触发onLoad,快速滑动的话是可以触发的,这个问题你解决了吗

@sf294383583
Copy link
Author

不算解决,感觉是滑动时距离计算问题,当不足触发距离时上划超过顶部会出现负数,所以会反向移动。现在先用了一个很弱智的方法规避了,就是当只有一条数据的时候往下面添加了一个空控件,类似这样:
_lists.length == 1 ? Container( height: 100 ): Container(),
先让看着正常了......

@xuelongqy
Copy link
Owner

最新源码已修复,将会在下一个版本发布

@xuelongqy
Copy link
Owner

已更新,请升级至2.0.5版本

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