SwipableStack constructor
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,
Implementation
SwipableStack({
required this.builder,
SwipableStackController? controller,
this.onSwipeCompleted,
this.onWillMoveNext,
this.overlayBuilder,
this.horizontalSwipeThreshold = _defaultHorizontalSwipeThreshold,
this.verticalSwipeThreshold = _defaultVerticalSwipeThreshold,
this.itemCount,
this.viewFraction = _defaultViewFraction,
this.swipeAssistDuration = _defaultSwipeAssistDuration,
this.stackClipBehaviour = _defaultStackClipBehaviour,
this.detectableSwipeDirections = _defaultDetectableSwipeDirections,
this.allowVerticalSwipe = true,
Curve? cancelAnimationCurve,
Curve? rewindAnimationCurve,
this.swipeAnchor,
this.dragStartBehavior = DragStartBehavior.start,
this.hitTestBehavior = HitTestBehavior.deferToChild,
this.dragStartDuration = const Duration(milliseconds: 150),
this.dragStartCurve = Curves.easeOut,
}) : controller = controller ?? SwipableStackController(),
cancelAnimationCurve =
cancelAnimationCurve ?? _defaultCancelAnimationCurve,
rewindAnimationCurve =
rewindAnimationCurve ?? _defaultRewindAnimationCurve,
assert(0 <= viewFraction && viewFraction <= 1),
assert(0 <= horizontalSwipeThreshold && horizontalSwipeThreshold <= 1),
assert(0 <= verticalSwipeThreshold && verticalSwipeThreshold <= 1),
assert(itemCount == null || itemCount >= 0),
super(key: controller?._swipableStackStateKey);