From a419b4b8e0857e44860810ee051a56a6aac8e248 Mon Sep 17 00:00:00 2001 From: ltOgt Date: Sat, 17 Aug 2024 11:54:51 +0200 Subject: [PATCH] undo format changes --- lib/src/widget/card_swiper_state.dart | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/src/widget/card_swiper_state.dart b/lib/src/widget/card_swiper_state.dart index 6873378..95d852b 100644 --- a/lib/src/widget/card_swiper_state.dart +++ b/lib/src/widget/card_swiper_state.dart @@ -1,6 +1,7 @@ part of 'card_swiper.dart'; -class _CardSwiperState extends State with SingleTickerProviderStateMixin { +class _CardSwiperState extends State + with SingleTickerProviderStateMixin { late CardAnimation _cardAnimation; late AnimationController _animationController; @@ -59,7 +60,8 @@ class _CardSwiperState extends State with SingleTi _detectedVerticalDirection = direction; } - widget.onSwipeDirectionChange?.call(_detectedHorizontalDirection, _detectedVerticalDirection); + widget.onSwipeDirectionChange + ?.call(_detectedHorizontalDirection, _detectedVerticalDirection); } @override @@ -186,7 +188,8 @@ class _CardSwiperState extends State with SingleTi Future _handleCompleteSwipe() async { final isLastCard = _currentIndex! == widget.cardsCount - 1; - final shouldCancelSwipe = await widget.onSwipe?.call(_currentIndex!, _nextIndex, _detectedDirection) == false; + final shouldCancelSwipe = await widget.onSwipe + ?.call(_currentIndex!, _nextIndex, _detectedDirection) == false; if (shouldCancelSwipe) { return; @@ -223,10 +226,14 @@ class _CardSwiperState extends State with SingleTi CardSwiperDirection _getEndAnimationDirection() { if (_cardAnimation.left.abs() > widget.threshold) { - return _cardAnimation.left.isNegative ? CardSwiperDirection.left : CardSwiperDirection.right; + return _cardAnimation.left.isNegative + ? CardSwiperDirection.left + : CardSwiperDirection.right; } if (_cardAnimation.top.abs() > widget.threshold) { - return _cardAnimation.top.isNegative ? CardSwiperDirection.top : CardSwiperDirection.bottom; + return _cardAnimation.top.isNegative + ? CardSwiperDirection.top + : CardSwiperDirection.bottom; } return CardSwiperDirection.none; }