SwipableStack class

A widget for stacking cards, which users can swipe horizontally and vertically with beautiful animations.

Inheritance

Constructors

SwipableStack({required SwipableStackItemBuilder builder, SwipableStackController? controller, SwipeCompletionCallback? onSwipeCompleted, OnWillMoveNext? onWillMoveNext, SwipableStackOverlayBuilder? overlayBuilder, double horizontalSwipeThreshold = _defaultHorizontalSwipeThreshold, double verticalSwipeThreshold = _defaultVerticalSwipeThreshold, int? itemCount, double viewFraction = _defaultViewFraction, Duration swipeAssistDuration = _defaultSwipeAssistDuration, Clip stackClipBehaviour = _defaultStackClipBehaviour, Set<SwipeDirection> detectableSwipeDirections = _defaultDetectableSwipeDirections, bool allowVerticalSwipe = true, Curve? cancelAnimationCurve, Curve? rewindAnimationCurve, SwipeAnchor? swipeAnchor, DragStartBehavior dragStartBehavior = DragStartBehavior.start, HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild, Duration dragStartDuration = const Duration(milliseconds: 150), Curve dragStartCurve = Curves.easeOut})

Properties

allowVerticalSwipe bool
Allow vertical swipe
final
builder SwipableStackItemBuilder
Builder for items to be displayed in SwipableStack.
final
cancelAnimationCurve Curve
A curve to animate the card when canceling the swipe.
final
controller SwipableStackController
An object to manipulate the SwipableStack.
final
detectableSwipeDirections Set<SwipeDirection>
The set of SwipeDirections you want to detect.
final
dragStartBehavior DragStartBehavior
The DragStartBehavior of the swipes.
final
dragStartCurve Curve
The Curve of the dragStartAnimation.
final
dragStartDuration Duration
The Duration of the dragStartAnimation.
final
hashCode int
The hash code for this object.
no setterinherited
hitTestBehavior HitTestBehavior
The HitTestBehavior of the underlying GestureDetector.
final
horizontalSwipeThreshold double
The threshold for horizontal swipes.
final
itemCount int?
The count of items to display.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onSwipeCompleted SwipeCompletionCallback?
Callback called when the Swipe is completed.
final
onWillMoveNext OnWillMoveNext?
Callback called just before launching the Swipe action.
final
overlayBuilder SwipableStackOverlayBuilder?
Builder for displaying an overlay on the most foreground card.
final
rewindAnimationCurve Curve
A curve to animate the card when rewinding the swipe.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackClipBehaviour Clip
final
swipeAnchor SwipeAnchor?
Where should the card be anchored on during swipe rotation
final
swipeAssistDuration Duration
How fast should the widget be swiped out of the screen when letting go? The faster you set this, the faster you're able to swipe another Widget of your stack.
final
verticalSwipeThreshold double
The threshold for vertical swipes.
final
viewFraction double
The second child size rate.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _SwipableStackState
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