- override
Override this method to check whether any children are located at the given position.
Typically children should be hit-tested in reverse paint order so that hit tests at locations where children overlap hit the child that is visually "on top" (i.e., paints later).
Used by hitTest
. If you override hitTest
and do not call this
function, then you don't need to implement this function.
Source
@override bool hitTestChildren(HitTestResult result, { Point position }) { assert(_children.length == rows * columns); for (int index = _children.length - 1; index >= 0; index -= 1) { RenderBox child = _children[index]; if (child != null) { final BoxParentData childParentData = child.parentData; Point transformed = new Point(position.x - childParentData.offset.dx, position.y - childParentData.offset.dy); if (child.hitTest(result, position: transformed)) return true; } } return false; }