Is it possible to show the previous Card on SwipeDown or Swipe left. The example application is always showing the next Card on whatever direction you swipe. The undo button works as expected but I can not do it on swipe.
bool _onSwipe(
int previousIndex,
int? currentIndex,
CardSwiperDirection direction,
) {
if (direction.name == 'left') {
debugPrint(
'The card $previousIndex was swiped to the ${direction.name}. Now the card $currentIndex is on top');
} else if (direction.name == 'right') {
debugPrint(
'The card $previousIndex was swiped to the ${direction.name}. Now the card $currentIndex is on top');
} else if (direction.name == 'top') {
debugPrint(
'The card $previousIndex was swiped to the ${direction.name}. Now the card $currentIndex is on top');
} else if (direction.name == 'bottom') {
controller.undo();
bool h = _onUndo(previousIndex - 1, currentIndex!, direction);
debugPrint(
'$h The card $previousIndex was swiped to the ${direction.name}. Now the card $currentIndex is on top');
} else {
debugPrint(
'The card $previousIndex was swiped to the ${direction.name}. Now the card $currentIndex is on top');
}
return true;
}