CardSwiper class

Inheritance

Constructors

CardSwiper({required NullableCardBuilder cardBuilder, required int cardsCount, CardSwiperController? controller, int initialIndex = 0, EdgeInsetsGeometry padding = const EdgeInsets.symmetric(horizontal: 20, vertical: 25), Duration duration = const Duration(milliseconds: 200), double maxAngle = 30, int threshold = 50, double scale = 0.9, bool isDisabled = false, CardSwiperOnTapDisabled? onTapDisabled, CardSwiperOnSwipe? onSwipe, CardSwiperOnEnd? onEnd, CardSwiperDirectionChange? onSwipeDirectionChange, AllowedSwipeDirection allowedSwipeDirection = const AllowedSwipeDirection.all(), bool isLoop = true, int numberOfCardsDisplayed = 2, CardSwiperOnUndo? onUndo, Offset backCardOffset = const Offset(0, 40), Key? key})
const

Properties

allowedSwipeDirection AllowedSwipeDirection
Defined the directions in which the card is allowed to be swiped. Defaults to AllowedSwipeDirection.all
final
backCardOffset Offset
The offset of the back card from the front card.
final
cardBuilder NullableCardBuilder
Function that builds each card in the stack.
final
cardsCount int
The number of cards in the stack.
final
controller CardSwiperController?
The CardSwiperController used to control the swiper externally.
final
duration Duration
The duration of each swipe animation.
final
hashCode int
The hash code for this object.
no setterinherited
initialIndex int
The index of the card to display initially.
final
isDisabled bool
Whether swiping is disabled.
final
isLoop bool
A boolean value that determines whether the card stack should loop. When the last card is swiped, if isLoop is true, the first card will become the last card again. The default value is true.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxAngle double
The maximum angle the card reaches while swiping.
final
numberOfCardsDisplayed int
An integer that determines the number of cards that are displayed at the same time. The default value is 2. Note that you must display at least one card, and no more than the cardsCount parameter.
final
onEnd CardSwiperOnEnd?
Callback function that is called when there are no more cards to swipe.
final
onSwipe CardSwiperOnSwipe?
Callback function that is called when a swipe action is performed.
final
onSwipeDirectionChange CardSwiperDirectionChange?
Callback function that is called when a card swipe direction changes.
final
onTapDisabled CardSwiperOnTapDisabled?
Callback function that is called when the swiper is disabled.
final
onUndo CardSwiperOnUndo?
Callback function that is called when a card is unswiped.
final
padding EdgeInsetsGeometry
The padding around the swiper.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
The scale of the card that is behind the front card.
final
threshold int
The threshold from which the card is swiped away.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited