Swipeable constructor

const Swipeable({
  1. required Key? key,
  2. required Widget child,
  3. BackgroundWidgetBuilder? backgroundBuilder,
  4. SwipeDirectionCallback? onSwiped,
  5. SwipeDirection direction = SwipeDirection.horizontal,
  6. double swipeThreshold = 0.4,
  7. Duration movementDuration = const Duration(milliseconds: 200),
  8. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  9. HitTestBehavior behavior = HitTestBehavior.opaque,
})

Creates a widget that can be swiped .

Implementation

const Swipeable({
  required super.key,
  required this.child,
  this.backgroundBuilder,
  this.onSwiped,
  this.direction = SwipeDirection.horizontal,
  this.swipeThreshold = 0.4,
  this.movementDuration = const Duration(milliseconds: 200),
  this.dragStartBehavior = DragStartBehavior.start,
  this.behavior = HitTestBehavior.opaque,
}) : assert(
        swipeThreshold >= 0.0 && swipeThreshold <= 1.0,
        'swipeThreshold must be between 0.0 and 1.0',
      );