public override void initState() { _controller = widget.controller; if (_controller == null) { _controller = new SwiperController(); } _controller.addListener(_onController); _handleAutoplay(); base.initState(); }
public override void didUpdateWidget(StatefulWidget oldWidget) { Swiper sp = oldWidget as Swiper; if (sp != null && _controller != sp.controller) { if (sp.controller != null) { sp.controller.removeListener(_onController); _controller = sp.controller; _controller.addListener(_onController); } } _handleAutoplay(); base.didUpdateWidget(oldWidget); }