I'm using card_swiper, and I can't find the way to invert vertical index swipe. I'm getting index 0,1,2,3... when moving to up, and lasts index when moving to down. I need this inverted, get 4,3,2,1,0 starting at 0, when moving to down. I know there should be a simple solution to this, even built into the package, but I can't find it. I tried changing axisDirection:AxisDirection.down, from the name seemed to do this, but it doesn't.
Swiper(
onIndexChanged: (int index) {
_currentIndex = index;
if (index == reelDataList!.length - 1) {
fetchReelDataList();
_updateSwipingSpeed();
}
},
scrollDirection: Axis.vertical,
itemCount: reelDataList!.length,
index: _currentIndex,
loop: false,
itemBuilder: (context, index) {},
)
The Swiper widget's built-in functionality does not directly support this specific behavior, so you'll have to manually manage the index and possibly use additional state to track the direction of the swipe.
to achieve 5,4,3,2,1.0,1,2,3,4,5, try