diff --git a/lib/src/card_animation.dart b/lib/src/card_animation.dart index 59e31d2..d6a9019 100644 --- a/lib/src/card_animation.dart +++ b/lib/src/card_animation.dart @@ -10,22 +10,22 @@ class CardAnimation { required this.maxAngle, required this.initialScale, required this.initialOffset, - @Deprecated('Use [cardSwipeDirection] instead]') + @Deprecated('Use [allowedSwipeDirection] instead]') this.isHorizontalSwipingEnabled = true, - @Deprecated('Use [cardSwipeDirection] instead]') + @Deprecated('Use [allowedSwipeDirection] instead]') this.isVerticalSwipingEnabled = true, - this.cardSwipeDirection = const AllowedSwipeDirection.all(), + this.allowedSwipeDirection = const AllowedSwipeDirection.all(), }) : scale = initialScale; final double maxAngle; final double initialScale; final Offset initialOffset; final AnimationController animationController; - @Deprecated('Use [cardSwipeDirection] instead]') + @Deprecated('Use [allowedSwipeDirection] instead]') final bool isHorizontalSwipingEnabled; - @Deprecated('Use [cardSwipeDirection] instead]') + @Deprecated('Use [allowedSwipeDirection] instead]') final bool isVerticalSwipingEnabled; - final AllowedSwipeDirection cardSwipeDirection; + final AllowedSwipeDirection allowedSwipeDirection; double left = 0; double top = 0; @@ -61,22 +61,22 @@ class CardAnimation { void update(double dx, double dy, bool inverseAngle) { //TODO: remove [isHorizontalSwipingEnabled] checks in the next major release if (isHorizontalSwipingEnabled) { - if (cardSwipeDirection.right && cardSwipeDirection.left) { + if (allowedSwipeDirection.right && allowedSwipeDirection.left) { left += dx; - } else if (cardSwipeDirection.right) { + } else if (allowedSwipeDirection.right) { if (left >= 0) left += dx; - } else if (cardSwipeDirection.left) { + } else if (allowedSwipeDirection.left) { if (left <= 0) left += dx; } } //TODO: remove [isHorizontalSwipingEnabled] checks in the next major release if (isVerticalSwipingEnabled) { - if (cardSwipeDirection.up && cardSwipeDirection.down) { + if (allowedSwipeDirection.up && allowedSwipeDirection.down) { top += dy; - } else if (cardSwipeDirection.up) { + } else if (allowedSwipeDirection.up) { if (top <= 0) top += dy; - } else if (cardSwipeDirection.down) { + } else if (allowedSwipeDirection.down) { if (top >= 0) top += dy; } } diff --git a/lib/src/card_swiper.dart b/lib/src/card_swiper.dart index 7a26268..61fd5e2 100644 --- a/lib/src/card_swiper.dart +++ b/lib/src/card_swiper.dart @@ -227,7 +227,7 @@ class _CardSwiperState extends State initialScale: widget.scale, isVerticalSwipingEnabled: widget.isVerticalSwipingEnabled, isHorizontalSwipingEnabled: widget.isHorizontalSwipingEnabled, - cardSwipeDirection: widget.allowedSwipeDirection, + allowedSwipeDirection: widget.allowedSwipeDirection, initialOffset: widget.backCardOffset, ); }