GeekyAnts / infinite-carousel-flutter

Carousel in flutter. Supports features like infinite looping, friction effect, multiple scroll physics and control over item anchor and velocity.
https://pub.dev/packages/infinite_carousel
MIT License
50 stars 30 forks source link

Question about item jump #13

Open 309791679 opened 1 year ago

309791679 commented 1 year ago

Example:

Number of projects: 10

Mode: Infinite Loop

ItemBuilder: (context, itemIndex, realIndex){

After scrolling left, the latest realIndex=-5, itemIndex=1

_ Controller. animateToItem (-4) corresponds to itemIndex=2

}

RealIndex=-3, itemIndex=3

Click the button to jump to controller. animateToItem (3)

The scrolling method is strange, I understand, but I need to change this situation

For example, the current realIndex=-42 itemIndex=5

Controller. animateToItem (3) realIndex=-40 instead of 3

Do you have any ideas