Closed FDhunterz closed 1 year ago
If I understood correctly, you are trying to identify whenever the carousel's pages are changed by manually scrolling between them.
You can do the following:
On your CarouselOptions, the onPageChanged property should include a verification for reason == CarouselPageChangedReason.manual:
We have 3 ways of changing the page on the carousel, which are the CarouselPageChangedReason enum: controller, timed and manual. By calling the controller.[next or previous]Page() - controller, By having passed the autoPlayInterval time set for it changing automatically - timed By the user manually scrolling from one page to another - manual.
onPageChanged: (index, reason) {
if (reason == CarouselPageChangedReason.manual) {
//do what you want here
}
},
anyone can help me?