From b5a473e3ed902ed1157c38b6d8c94ab685e9beaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=AD=8C?= Date: Sun, 20 Dec 2020 17:45:48 +0800 Subject: [PATCH] =?UTF-8?q?fix=20needless=20'setState'=C2=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/swiper.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/src/swiper.dart b/lib/src/swiper.dart index 9783740..42ccc90 100644 --- a/lib/src/swiper.dart +++ b/lib/src/swiper.dart @@ -452,9 +452,7 @@ class _SwiperState extends _SwiperTimerMixin { } void _onIndexChanged(int index) { - setState(() { - _activeIndex = index; - }); + _activeIndex = index; if (widget.onIndexChanged != null) { widget.onIndexChanged(index); }