swipeRight method

Future<void> swipeRight()

Swipe the top Widget to the right.

If there is no animation already in progress, trigger the animation to swipe the top Widget to the right, call the function onRightSwipe, and remove the Widget from the deck. If the deck is empty, call the function onDeckEmpty.

Implementation

Future<void> swipeRight() async {
  if (animationActive || cardDeck.isEmpty) return;
  await _swipeCard(right, screenSize);
  onRightSwipe(cardDeck.last);
  cardDeck.removeLast();
  if (cardDeck.isEmpty) onDeckEmpty();
}