getPositionForChild method
size — the layout box size (= the screen, see class doc);
childSize — the tooltip's actual size after layout.
Implementation
@override
Offset getPositionForChild(Size size, Size childSize) {
assert(
size.width == screenLocal.width && size.height == screenLocal.height,
'layout box must be the screen (screenLocal.size == box size)',
);
for (final side in _sideOrder) {
final offset = _offsetFor(side, childSize);
if (_fits(offset, childSize)) return offset;
}
// No side fit (tooltip/hole larger than the screen) — a corner.
return Offset(
screenLocal.left + _fallbackPadding,
screenLocal.top + _fallbackPadding,
);
}