Open DanielMohammadii opened 1 year ago
The item count property in carousel slider builder defines the number of pages. You may have some problem in sanpshot.data!.docs.length
I'm also seeing this, even if I manually set itemCount
to a literal like 10
my pageViewIndex
starts at 10000.
Edit: I just had a look and it's set manually in carousel_state.dart#L21 in order to allow infinite scrolling which makes sense. However I'm also noticing that it often gets the index wrong. E.g. if I scroll to the next or previous item but then continue to keep the drag going and reverse it back to the original item it reports the pageViewIndex incorrectly.
You can disable infinite scrolling in options and for the drag issue you will need to update controller about the page. You could add left and right buttons or pagination dots.