Swipe constructor

Swipe({
  1. required Animation<double> animation,
  2. required Widget child,
  3. required double screenMaximumPercentage,
  4. required bool hasEnableGestures,
  5. required bool disableAnimations,
  6. SwipeGestures? gestures,
  7. bool animateChild = true,
  8. bool onNotification(
    1. DraggableScrollableNotification
    )?,
  9. AxisDirection direction = AxisDirection.up,
  10. Key? key,
})

Implementation

new({
  required this.animation,
  required Widget child,
  required this.screenMaximumPercentage,
  required bool hasEnableGestures,
  required this.disableAnimations,
  this.gestures,
  this.animateChild = true,
  bool Function(DraggableScrollableNotification)? onNotification,
  this.direction = AxisDirection.up,
  super.key,
}) : _child = hasEnableGestures
         ? NotificationListener<DraggableScrollableNotification>(
             onNotification: onNotification,
             child: GestureDetector(
               excludeFromSemantics: true,
               onVerticalDragStart: direction.generic() == Axis.vertical
                   ? gestures?.handleDragStart
                   : null,
               onVerticalDragEnd: direction.generic() == Axis.vertical
                   ? gestures?.handleDragEnd
                   : null,
               onVerticalDragUpdate: direction.generic() == Axis.vertical
                   ? gestures?.handleDragUpdate
                   : null,
               onHorizontalDragStart: direction.generic() == Axis.horizontal
                   ? gestures?.handleDragStart
                   : null,
               onHorizontalDragUpdate: direction.generic() == Axis.horizontal
                   ? gestures?.handleDragUpdate
                   : null,
               onHorizontalDragEnd: direction.generic() == Axis.horizontal
                   ? gestures?.handleDragEnd
                   : null,
               child: child,
             ),
           )
         : child;