SwipeCard class

Simple swipeable card widget that wraps custom content.

This widget provides swipe-to-dismiss functionality with smooth rolling animations while delegating the visual content to the customWidget.

Inheritance

Constructors

SwipeCard({Key? key, required int index, required Set<int> removedCards, required Map<int, double> swipeProgress, required Widget customWidget, required VoidCallback onDismissed, required ValueChanged<double> onSwipeUpdate, required double cardWidth, double cardSpacing = 16, Duration animationDuration = const Duration(milliseconds: 180), Curve animationCurve = Curves.fastOutSlowIn, CardSwipeTransforms? customTransformCallback(int cardIndex, CardSwipeTransforms baseTransforms, double swipeProgress, List<int> removedCards, double cardWidth, double cardSpacing)?})
const

Properties

animationCurve Curve
Curve for card animations
final
animationDuration Duration
Duration for card animations
final
cardSpacing double
Spacing between cards
final
cardWidth double
Width of the card
final
customTransformCallback CardSwipeTransforms? Function(int cardIndex, CardSwipeTransforms baseTransforms, double swipeProgress, List<int> removedCards, double cardWidth, double cardSpacing)?
Custom transform callback
final
customWidget Widget
Custom widget to display as card content
final
hashCode int
The hash code for this object.
no setterinherited
index int
The index of this card (0-based)
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDismissed VoidCallback
Callback when the card is dismissed
final
onSwipeUpdate ValueChanged<double>
Callback when swipe progress updates
final
removedCards Set<int>
All removed card indices
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
swipeProgress Map<int, double>
Swipe progress for all cards
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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, int wrapWidth = 65}) 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