Skip to content

Commit acb8e62

Browse files
Merge pull request #151 from guzishiwo/master
fix page slide activateIndactor not refresh
2 parents 3b69436 + a06403f commit acb8e62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/components/carousel/gf_carousel.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class _GFCarouselState extends State<GFCarousel> with TickerProviderStateMixin {
182182
}
183183

184184
Timer getPlayTimer() => Timer.periodic(widget.autoPlayInterval, (_) {
185-
if (widget.autoPlay) {
185+
if (widget.autoPlay && widget.items.length > 1) {
186186
widget.pageController.nextPage(
187187
duration: widget.autoPlayAnimationDuration,
188188
curve: widget.autoPlayCurve);
@@ -221,7 +221,7 @@ class _GFCarouselState extends State<GFCarousel> with TickerProviderStateMixin {
221221
}
222222

223223
void onPageSlide(int index) {
224-
setState(() => index);
224+
setState(() => currentSlide = index);
225225
}
226226

227227
int currentSlide;

0 commit comments

Comments
 (0)