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

v3版本有考虑再添加v2版本的BallPulseHeader、BallPulseFooter吗 #689

Closed
iotjin opened this issue Feb 28, 2023 · 2 comments
Closed

Comments

@iotjin
Copy link

iotjin commented Feb 28, 2023

如题,我看v3版本已经废弃了BallPulseHeader和BallPulseFooter,通过BezierHeader使用SpinKitThreeBounce虽然也能实现类似的效果,但是感觉没有v2版本的丝滑,我观察两者效果主要区别在下拉的时候v2版本已经出现动画,v3版本要等到松手时才出现,如果网络请求时间比较短,三个球的动画刚出现可能就消失了,显得比较突兀

下面是v3版本实现类似效果的关键代码:

EasyRefresh(
      controller: _controller,
      header: const BezierHeader(
        triggerOffset: 100,
        backgroundColor: Colors.transparent,
        foregroundColor: Colors.grey,
        clamping: false,
        showBalls: false,
        springRebound: false,
        spinWidget: SpinKitThreeBounce(size: 32, color: Colors.blue),
      ),
      onRefresh: () async => _requestData(),
      onLoad: () async => _requestData(isLoadMore: true),
      child: _listWidget(),
    )

请求完成,得加个延时才不会那么的突兀。

Future.delayed(const Duration(seconds: 2), () {
    _dataArr = tempData;
    _controller.finishRefresh();
    _controller.resetFooter();
 });
@xuelongqy
Copy link
Owner

实现起来应该不复杂。可以参考v2的源码和BezierBackground结合,如果你有时间提交pr的话,那就更好了

@xuelongqy
Copy link
Owner

3.3.2+1,可设置onlySpin。如果还有问题,请重新开启此issue

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

2 participants