SwipableStack constructor

SwipableStack({
  1. required SwipableStackItemBuilder builder,
  2. SwipableStackController? controller,
  3. SwipeCompletionCallback? onSwipeCompleted,
  4. OnWillMoveNext? onWillMoveNext,
  5. SwipableStackOverlayBuilder? overlayBuilder,
  6. double horizontalSwipeThreshold = _defaultHorizontalSwipeThreshold,
  7. double verticalSwipeThreshold = _defaultVerticalSwipeThreshold,
  8. int? itemCount,
  9. double viewFraction = _defaultViewFraction,
  10. Duration swipeAssistDuration = _defaultSwipeAssistDuration,
  11. Clip stackClipBehaviour = _defaultStackClipBehaviour,
  12. Set<SwipeDirection> detectableSwipeDirections = _defaultDetectableSwipeDirections,
  13. bool allowVerticalSwipe = true,
  14. Curve? cancelAnimationCurve,
  15. Curve? rewindAnimationCurve,
  16. SwipeAnchor? swipeAnchor,
  17. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  18. HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild,
  19. Duration dragStartDuration = const Duration(milliseconds: 150),
  20. 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);