RenderMouseRegion constructor Null safety

RenderMouseRegion(
  1. {PointerEnterEventListener? onEnter,
  2. PointerHoverEventListener? onHover,
  3. PointerExitEventListener? onExit,
  4. MouseCursor cursor = MouseCursor.defer,
  5. bool validForMouseTracker = true,
  6. bool opaque = true,
  7. RenderBox? child,
  8. HitTestBehavior? hitTestBehavior = HitTestBehavior.opaque}
)

Creates a render object that forwards pointer events to callbacks.

All parameters are optional. By default this method creates an opaque mouse region with no callbacks and cursor being MouseCursor.defer. The cursor must not be null.

Implementation

RenderMouseRegion({
  this.onEnter,
  this.onHover,
  this.onExit,
  MouseCursor cursor = MouseCursor.defer,
  bool validForMouseTracker = true,
  bool opaque = true,
  super.child,
  HitTestBehavior? hitTestBehavior = HitTestBehavior.opaque,
}) : assert(opaque != null),
     assert(cursor != null),
     _cursor = cursor,
     _validForMouseTracker = validForMouseTracker,
     _opaque = opaque,
     super(behavior: hitTestBehavior ?? HitTestBehavior.opaque);