behavior property

HitTestBehavior behavior
final

How the game widget behaves during hit testing.

  • HitTestBehavior.opaque (default): the game absorbs all pointer events on its surface, preventing widgets behind it from receiving them.
  • HitTestBehavior.deferToChild: the game only intercepts events at positions where a component with event callbacks (e.g. TapCallbacks) exists. Events at other positions pass through to widgets behind.
  • HitTestBehavior.translucent: the game receives events where it has event-handling components, but always allows widgets behind it to be hit-tested as well.

Implementation

final HitTestBehavior behavior;