Closed peterbullmatti closed 1 year ago
Use a transparent pageView as the middleware. The pageView follows CarouselSlider, and the SmoothPageIndicator follows the pageView
Use ValueNotifier
onPageChanged: (int index, reason) => _valueNotifier.value = index
And then you can just use AnimatedSmoothIndicator with activeIndex property like this:
ValueListenableBuilder<int>(
valueListenable: _valueNotifier,
builder: (BuildContext context, int index, Widget? child) =>
AnimatedSmoothIndicator(
activeIndex: index,
axisDirection: Axis.horizontal,
count: images.length,
onDotClicked: _carouselController.animateToPage))
use AnimatedSmoothIndicator instead of SmoothPageIndicator, there no need of any controller just need to pass activeIndex
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions
before SmoothPageIndicator works fine with CarouselSlider since it just needs an activeIndex, but the current version of SmoothPageIndicator need a Pagecontroller, and what I have is a CarouselController, how could I transfer this CarouselController to a pagecontroller?
thank you!