card_swiper
card_swiper copied to clipboard
当自动轮播时,swiperController.index并不会随着改变
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一起改变
same question