Listener constructor Null safety

const Listener(
  1. {Key? key,
  2. PointerDownEventListener? onPointerDown,
  3. PointerMoveEventListener? onPointerMove,
  4. PointerUpEventListener? onPointerUp,
  5. PointerHoverEventListener? onPointerHover,
  6. PointerCancelEventListener? onPointerCancel,
  7. PointerPanZoomStartEventListener? onPointerPanZoomStart,
  8. PointerPanZoomUpdateEventListener? onPointerPanZoomUpdate,
  9. PointerPanZoomEndEventListener? onPointerPanZoomEnd,
  10. PointerSignalEventListener? onPointerSignal,
  11. HitTestBehavior behavior = HitTestBehavior.deferToChild,
  12. Widget? child}
)

Creates a widget that forwards point events to callbacks.

The behavior argument defaults to HitTestBehavior.deferToChild.

Implementation

const Listener({
  super.key,
  this.onPointerDown,
  this.onPointerMove,
  this.onPointerUp,
  this.onPointerHover,
  this.onPointerCancel,
  this.onPointerPanZoomStart,
  this.onPointerPanZoomUpdate,
  this.onPointerPanZoomEnd,
  this.onPointerSignal,
  this.behavior = HitTestBehavior.deferToChild,
  super.child,
}) : assert(behavior != null);