swipeLeft method

Future<void> swipeLeft()

Swipe the top Widget to the left.

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

Implementation

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