card_swiper icon indicating copy to clipboard operation
card_swiper copied to clipboard

I found that it would automatically scroll several times the first time

Open zjypp opened this issue 1 year ago • 8 comments

I obtained the data list through the backend interface, and when binding the card swiper, I found that it would automatically scroll several times the first time before stopping at the index position. This is why and how to avoid this problem, so that it should not automatically scroll a few times and directly locate at the index position the first time

when loop = true;

This is the log of index changes that I output, Finally locate at index=2

I/flutter (23982): spwiere index , 0 I/flutter (23982): spwiere index , 0 I/flutter (23982): spwiere index , 4 I/flutter (23982): spwiere index , 4 I/flutter (23982): spwiere index , 1 I/flutter (23982): spwiere index , 1 I/flutter (23982): spwiere index , 4 I/flutter (23982): spwiere index , 2 I/flutter (23982): spwiere index , 5 I/flutter (23982): spwiere index , 5 I/flutter (23982): spwiere index , 2 I/flutter (23982): spwiere index , 5 I/flutter (23982): spwiere index , 0 I/flutter (23982): spwiere index , 3 I/flutter (23982): spwiere index , 3 I/flutter (23982): spwiere index , 5 I/flutter (23982): spwiere index , 4 I/flutter (23982): spwiere index , 0 I/flutter (23982): spwiere index , 5 I/flutter (23982): spwiere index , 2 I/flutter (23982): spwiere index , 5 I/flutter (23982): spwiere index , 0 I/flutter (23982): spwiere index , 1 I/flutter (23982): spwiere index , 5 I/flutter (23982): spwiere index , 2 I/flutter (23982): spwiere index , 3 I/flutter (23982): spwiere index , 4 I/flutter (23982): spwiere index , 5 I/flutter (23982): spwiere index , 0

zjypp avatar Jun 08 '23 09:06 zjypp

I also encountered continuous scrolling when loading for the first time, I load the component by checking if the data source is empty hope to help you

PostLiu avatar Jun 13 '23 08:06 PostLiu

Same problem, did you find a solution?

ljhao24 avatar Aug 28 '23 08:08 ljhao24

我第一次加载时也遇到了连续滚动的情况, 我通过检查数据源是否为空来加载组件 希望对你有帮助

按你的办法解决了,谢谢

qpc2015 avatar Aug 31 '23 09:08 qpc2015

Same problem, did you find a solution?

when the data is not null,load the widget,problem solved.

TheLittleMatch avatar Sep 15 '23 09:09 TheLittleMatch

Same problem here when putting Swiper inside a Sliver widget any solution ?

khang-dev avatar Oct 07 '23 06:10 khang-dev

Same problem here when putting Swiper inside a Sliver widget any solution ?

When the data is empty, this problem occurs. My solution is to not display the component when the data is empty. Once the data is obtained, the component can be displayed. You can use a ternary expression to check this.

TheLittleMatch avatar Oct 07 '23 06:10 TheLittleMatch

遇到同样问题,首次打开,swiper那里来回跳 card_swiper: dependency: "direct main" description: name: card_swiper sha256: "0c94c538f47be1dab52d018d4900a7046b4cb0700dc7f95b8628da89d1212b35" url: "https://pub.dev" source: hosted version: "2.0.4"

hc2088 avatar Mar 26 '24 08:03 hc2088

我尝试了各种种方案,感觉可能和使用getx有关系。但是也没定位问题。 最后无奈换了个插件。

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年03月26日 16:11 | | 收件人 | @.> | | 抄送至 | Jason @.>@.> | | 主题 | Re: [TheAnkurPanchani/card_swiper] I found that it would automatically scroll several times the first time (Issue #73) |

遇到同样问题,首次打开,swiper那里来回跳

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

zjypp avatar Mar 26 '24 08:03 zjypp