Swipeable constructor
const
Swipeable({
- required Key? key,
- required Widget child,
- BackgroundWidgetBuilder? backgroundBuilder,
- SwipeDirectionCallback? onSwiped,
- SwipeDirection direction = SwipeDirection.horizontal,
- double swipeThreshold = 0.4,
- Duration movementDuration = const Duration(milliseconds: 200),
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- 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',
);