card_swiper icon indicating copy to clipboard operation
card_swiper copied to clipboard

当自动轮播时,swiperController.index并不会随着改变

Open meng-fucius opened this issue 2 years ago • 1 comments

 onIndexChanged: (index) async {
            print('$index & ${_swiperController.index}');
          },

输出为:

I/flutter ( 8370): 1 & 0
I/flutter ( 8370): 2 & 0
I/flutter ( 8370): 0 & 0
I/flutter ( 8370): 1 & 0
I/flutter ( 8370): 2 & 0
I/flutter ( 8370): 0 & 0

这样导致我在监听轮播变化时,无法得知当前正在轮播哪张图 例如:

_swiperController.addListener(() {
      print(_swiperController.index);
//other code
    });

输出:

I/flutter ( 8370): 0
I/flutter ( 8370): 0
I/flutter ( 8370): 0
I/flutter ( 8370): 0
I/flutter ( 8370): 0

请问是否可以在自动轮播时使swiperController.index一起改变

meng-fucius avatar Jan 23 '22 09:01 meng-fucius

same question

sgehrman avatar Feb 10 '24 23:02 sgehrman