defaultHitTestChildren method
Performs a hit test on each child by walking the child list backwards.
Stops walking once after the first child reports that it contains the given point. Returns whether any children contain the given point.
See also:
- defaultPaint, which paints the children appropriate for this hit-testing strategy.
Implementation
@override
bool defaultHitTestChildren(BoxHitTestResult result, {required Offset position}) {
for (final child in _painted().reversed) {
final hit = result.addWithPaintOffset(
offset: (child.parentData! as FlexParentData).offset,
position: position,
hitTest: (r, p) => child.hitTest(r, position: p),
);
if (hit) return true;
}
return false;
}