CardSwiper class

Inheritance

Constructors

CardSwiper({Key? key, required NullableIndexedWidgetBuilder 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, CardSwiperDirection direction = CardSwiperDirection.right, bool isHorizontalSwipingEnabled = true, bool isVerticalSwipingEnabled = true, bool isLoop = true, int numberOfCardsDisplayed = 2, CardSwiperOnUndo? onUndo})
const

Properties

cardBuilder NullableIndexedWidgetBuilder
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
direction CardSwiperDirection
The direction in which the card is swiped when triggered by the controller.
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
isHorizontalSwipingEnabled bool
A boolean value that determines whether the card can be swiped horizontally. The default value is true.
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
isVerticalSwipingEnabled bool
A boolean value that determines whether the card can be swiped vertically. 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
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