DragTarget<T extends Object> constructor

const DragTarget<T extends Object>({
  1. Key? key,
  2. required DragTargetBuilder<T> builder,
  3. @Deprecated('Use onWillAcceptWithDetails instead. ' 'This callback is similar to onWillAcceptWithDetails but does not provide drag details. ' 'This feature was deprecated after v3.14.0-0.2.pre.') DragTargetWillAccept<T>? onWillAccept,
  4. DragTargetWillAcceptWithDetails<T>? onWillAcceptWithDetails,
  5. @Deprecated('Use onAcceptWithDetails instead. ' 'This callback is similar to onAcceptWithDetails but does not provide drag details. ' 'This feature was deprecated after v3.14.0-0.2.pre.') DragTargetAccept<T>? onAccept,
  6. DragTargetAcceptWithDetails<T>? onAcceptWithDetails,
  7. DragTargetLeave<T>? onLeave,
  8. DragTargetMove<T>? onMove,
  9. HitTestBehavior hitTestBehavior = HitTestBehavior.translucent,
})

Creates a widget that receives drags.

Implementation

const DragTarget({
  super.key,
  required this.builder,
  @Deprecated(
    'Use onWillAcceptWithDetails instead. '
    'This callback is similar to onWillAcceptWithDetails but does not provide drag details. '
    'This feature was deprecated after v3.14.0-0.2.pre.'
  )
  this.onWillAccept,
  this.onWillAcceptWithDetails,
  @Deprecated(
    'Use onAcceptWithDetails instead. '
    'This callback is similar to onAcceptWithDetails but does not provide drag details. '
    'This feature was deprecated after v3.14.0-0.2.pre.'
  )
  this.onAccept,
  this.onAcceptWithDetails,
  this.onLeave,
  this.onMove,
  this.hitTestBehavior = HitTestBehavior.translucent,
}) : assert(onWillAccept == null || onWillAcceptWithDetails == null, "Don't pass both onWillAccept and onWillAcceptWithDetails.");