card_swiper icon indicating copy to clipboard operation
card_swiper copied to clipboard

在GetX框架下使用card_swiper有几个问题,设置loop=true的时候,卡片会随机滚动一会才会停下来

Open zjypp opened this issue 1 year ago • 8 comments

Widget getSwiper(){ return Obx(() { return Swiper( itemBuilder:(BuildContext context,int index){ return _swiperItem(context,index); }, itemCount: state.ktszWordListEntity.value.result.length, pagination: null, control: null, loop: false, viewportFraction: 0.9, scale: 1, index: 0,///插件有bug,只有0起作用。 onIndexChanged: (index){ controller.slide(index); }, ); }); } 1.当设置loop=true的时候,页面刚开始卡片会随机滚动一会,才会停下来,停下来的位置也是随机的,设置loop=false以后没这个问题 2.当设置index 非0点时候,这个参数不起作用。

第1个问题,如果不是要Getx的Obx包裹的话,loop=true是起作用。 是不是在GetX下使用card_swiper不是这样的用法吗?

zjypp avatar Jan 14 '24 02:01 zjypp

哥们问题解决了么

86linksrain avatar Feb 20 '24 11:02 86linksrain

你也碰见这个问题了吗?没有解决。但是我感觉这个问题很基础啊,如果这个问题都有的话,应该有很多人反馈。但是我看反馈区几乎没有人反馈这个问题。我感觉是不是我们在哪里使用错了,在使用getx的时候。最后我换了另外一个插件。

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年02月20日 19:44 | | 收件人 | @.> | | 抄送至 | Jason @.>@.> | | 主题 | Re: [TheAnkurPanchani/card_swiper] 在GetX框架下使用card_swiper有几个问题,设置loop=true的时候,卡片会随机滚动一会才会停下来 (Issue #98) |

哥们问题解决了么

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

zjypp avatar Feb 20 '24 11:02 zjypp

加个Visibility 没有数据的隐藏 有数据的时候显示

pangyu646182805 avatar Mar 15 '24 02:03 pangyu646182805

我也遇到这个问题了。。你换成什么插件了啊?

你也碰见这个问题了吗?没有解决。但是我感觉这个问题很基础啊,如果这个问题都有的话,应该有很多人反馈。但是我看反馈区几乎没有人反馈这个问题。我感觉是不是我们在哪里使用错了,在使用getx的时候。最后我换了另外一个插件。 ---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年02月20日 19:44 | | 收件人 | @.> | | 抄送至 | Jason @.>@.> | | 主题 | Re: [TheAnkurPanchani/card_swiper] 在GetX框架下使用card_swiper有几个问题,设置loop=true的时候,卡片会随机滚动一会才会停下来 (Issue #98) | 哥们问题解决了么 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

LiuDongCai avatar Mar 20 '24 03:03 LiuDongCai

我换成了appinio_swiper,这个插件。但是这个效果和原来的那个插件效果不一样。 这个是堆叠的卡片形式。能解决上面说的那个问题,但是表现形式不一样了。

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年03月20日 11:28 | | 收件人 | @.> | | 抄送至 | Jason @.>@.> | | 主题 | Re: [TheAnkurPanchani/card_swiper] 在GetX框架下使用card_swiper有几个问题,设置loop=true的时候,卡片会随机滚动一会才会停下来 (Issue #98) |

我也遇到这个问题了。。你换成什么插件了啊?

你也碰见这个问题了吗?没有解决。但是我感觉这个问题很基础啊,如果这个问题都有的话,应该有很多人反馈。但是我看反馈区几乎没有人反馈这个问题。我感觉是不是我们在哪里使用错了,在使用getx的时候。最后我换了另外一个插件。 … ---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年02月20日 19:44 | | 收件人 | @.> | | 抄送至 | Jason @.>@.> | | 主题 | Re: [TheAnkurPanchani/card_swiper] 在GetX框架下使用card_swiper有几个问题,设置loop=true的时候,卡片会随机滚动一会才会停下来 (Issue #98) | 哥们问题解决了么 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

— 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 21 '24 11:03 zjypp

Widget getSwiper(){ return Obx(() { return Swiper( itemBuilder:(BuildContext context,int index){ return _swiperItem(context,index); }, itemCount: state.ktszWordListEntity.value.result.length, pagination: null, control: null, loop: false, viewportFraction: 0.9, scale: 1, index: 0,///插件有bug,只有0起作用。 onIndexChanged: (index){ controller.slide(index); }, ); }); } 1.当设置loop=true的时候,页面刚开始卡片会随机滚动一会,才会停下来,停下来的位置也是随机的,设置loop=false以后没这个问题 2.当设置index 非0点时候,这个参数不起作用。

第1个问题,如果不是要Getx的Obx包裹的话,loop=true是起作用。 是不是在GetX下使用card_swiper不是这样的用法吗?

You can add a key to Swiper:

 final list  = ....; // your data.
Swiper(
 key: ValueKey(list.isNotEmpty),
 itemCount: list.length,
)

gcks568 avatar Jul 09 '24 06:07 gcks568

有解决方案吗?

giantss avatar Aug 08 '24 08:08 giantss

有个人留言说加个key,不过我没有尝试呢

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年08月08日 16:34 | | 收件人 | @.> | | 抄送至 | Jason @.>@.> | | 主题 | Re: [TheAnkurPanchani/card_swiper] 在GetX框架下使用card_swiper有几个问题,设置loop=true的时候,卡片会随机滚动一会才会停下来 (Issue #98) |

有解决方案吗?

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

zjypp avatar Aug 08 '24 08:08 zjypp