I am working with a carousel_slider on a flutter mission and I primarily am loading information for the person to see and giving them the flexibility to swipe by way of numerous pages of content material and data. The person then clicks a button and new information is loaded into the view. The difficulty I am having is that I would like the slider to default again to the preliminary web page anytime that the information adjustments. At present, if the person is on web page 2 then the information will change for that web page, however they must swipe to be able to get again to web page 0. Is there a strategy to override the slider and inform it to leap again to web page Zero when I’ve a changeState to replace the information being proven? From what I’ve seen within the carousel_slider library there does not appear to be something documented that may obtain this, and I have never seen every other discussions or questions on this anyplace. Code is under for my slider.
return CarouselSlider( choices: CarouselOptions( top: top, initialPage: 0, viewportFraction: 1.0, enlargeCenterPage: false, autoPlay: false, ), gadgets: pageNumbers .map((merchandise) => Container( youngster: Middle(youngster: product(merchandise)), )) .toList(), );
There are a complete of three totally different pages I am working with, with web page Zero being the default web page that I wish to have customers leap again to at any time when the information adjustments.