hitTestBoxChild method

  1. @override
bool hitTestBoxChild({
  1. required RenderBox child,
  2. required Offset position,
  3. required Matrix4 transform,
  4. required bool checkBounds,
})
override

Hit tests a RenderBox child at position with a transform.

Implementation

@override
bool hitTestBoxChild({
  required RenderBox child,
  required Offset position,
  required Matrix4 transform,
  required bool checkBounds,
}) {
  return BoxHitTestResult.wrap(hitTestResult!).addWithPaintTransform(
    transform: transform,
    position: position,
    hitTest: (result, position) {
      if (checkBounds && !(Offset.zero & child.size).contains(position)) {
        return false;
      }
      return child.hitTest(result, position: position);
    },
  );
}