diff --git a/lib/components/carousel/gf_carousel.dart b/lib/components/carousel/gf_carousel.dart index b7c08cd0..9f8cd410 100644 --- a/lib/components/carousel/gf_carousel.dart +++ b/lib/components/carousel/gf_carousel.dart @@ -182,7 +182,7 @@ class _GFCarouselState extends State with TickerProviderStateMixin { } Timer getPlayTimer() => Timer.periodic(widget.autoPlayInterval, (_) { - if (widget.autoPlay) { + if (widget.autoPlay && widget.items.length > 1) { widget.pageController.nextPage( duration: widget.autoPlayAnimationDuration, curve: widget.autoPlayCurve); @@ -221,7 +221,7 @@ class _GFCarouselState extends State with TickerProviderStateMixin { } void onPageSlide(int index) { - setState(() => index); + setState(() => currentSlide = index); } int currentSlide;