- Added
CardAnimation.animateToAngle
helper to animate swipe the card to any given angle between 0-360°. - Added
CardAnimation.animateUndoFromAngle
helper method to undo animation from any angle. - Removed previous implementations for the above in the
CardAnimation
class, namely -animateHorizontally
,animateVertically
,animateUndoHorizontally
, andanimateUndoVertically
. - Replaced
enum CardSwiperDirection
withclass CardSwiperDirection
to support custom angle swiping.
- Tracks
StreamSubscription<ControllerEvent>
givenwidget.controller
, and callscancel
on dispose.
- Prevents
CardSwiperController
to be disposed byCardSwiper
.
- Adds
moveTo
method toCardSwiperController
to move to a specific card index. - BREAKING CHANGE:
- Upgrade min dart sdk to 3.0.0
- Replace
swipe
,swipeLeft
,swipeRight
,swipeUp
,swipeDown
withswipe(CardSwiperDirection direction)
- It also removes
direction
from theCardSwiper
widget
- It also removes
- Fixes cannot access context in onSwipe when no cards left then "destroy" the widget tree
- Make only and symetric const constructor for AllowedSwipeDirection
- Adds
onSwipeDirectionChange
callback containing the horizontal and vertical swipe direction - BREAKING CHANGE:
- Modifies the
cardBuilder
callback, to include the ratio of horizontal drag to threshold as a percentage and the ratio of vertical drag to threshold as a percentage.
- Modifies the
- BREAKING CHANGE:
isHorizontalSwipingEnabled
andisVerticalSwipingEnabled
have been removed. UseallowedSwipeDirection
instead.
- Adds AllowedSwipeDirection to allow card to be swiped in any combination of left, right, up or down directions.
- DEPRECATION:
isHorizontalSwipingEnabled
andisVerticalSwipingEnabled
have been deprecated. UseallowedSwipeDirection
instead.
- Adds support for negative back card offset.
- Fix only 2 cards displayed even when numberOfCardsDisplayed param is greater than 2.
- Adds option to customize the back card offset.
- BREAKING CHANGE:
CardSwiperController
is no longer disposed byCardSwiper
, but who created it must dispose it.
- Fix Swiping when
isDisabled
istrue
and triggered by thecontroller
.
- Fixes the
isHorizontalSwipingEnabled
andisVerticalSwipingEnabled
.
- Changes
onSwipe
andonEnd
callbacks to be FutureOr.
- Adds option to undo swipes.
- Fixes
onSwipe
callback being called twice.
- Updates the docs.
- BREAKING CHANGE:
- CardSwipers onSwipe function now returns
<bool>
instead of<void>
. If onSwipe returnsfalse
, the swipe action will now be canceled and the current card will remain on top of the stack. Otherwise, if it returnstrue
, the swipe action will be performed as expected.
- CardSwipers onSwipe function now returns
- Adds option to set the initial index of the swiper.
- BREAKING CHANGES:
- Adds currentIndex and previousIndex to the onSwipe callback.
- Renders the items through a builder function.
- Add option to display more cards at a time. Useful if the widgets you want in your cards take time to build (for example a network image or video): displaying more cards builds them in advance and makes a fast serie of swipes more fluid.
- Fixes wrong item rendering.
- Makes CardSwiper a generic of
Widget?
. - Adds option to control if the stack should loop or not.
- BREAKING CHANGE:
- Now CardSwiper is a stack, meaning that the last item is now the visible item.
- Add option to disable vertical or horizontal swipping
- Allow changing the scale of the card that is behind the front card
- Dispose the CardSwiperController to avoid memory leaks
- Add option to slide up and down through controller
- Make all callbacks type-safe
- Fix problem with the back card not being rendered
- Based on Appinio Swiper