hitTestSliverChild method
bool
hitTestSliverChild({
- required RenderSliver child,
- required Offset position,
- required Matrix4 transform,
- required bool checkBounds,
override
Hit tests a RenderSliver child at position
with a transform
.
Implementation
@override
bool hitTestSliverChild({
required RenderSliver child,
required Offset position,
required Matrix4 transform,
required bool checkBounds,
}) {
position = position.rotateWithAxis(child.constraints.axis);
return hitTestResult!.addWithPaintTransform(
transform: transform,
position: position,
hitTest: (result, position) {
if (checkBounds &&
!(Offset.zero & child.hitTestSize).contains(position)) {
return false;
}
return child.hitTest(
SliverHitTestResult.wrap(result),
crossAxisPosition: position.dx,
mainAxisPosition: position.dy,
);
},
);
}