performLayout method
Override this method to lay out and position all children given this widget's size.
This method must call layoutChild for each child. It should also specify the final position of each child with positionChild.
Implementation
@override
void performLayout(Size size) {
final avoid = <Rect>[holeLocal, ...extraHoles];
// Tooltip slots get loose constraints (up to the screen size) — the same
// as the single-tooltip path; a tight box would stretch them.
final constraints = BoxConstraints.loose(size);
// The primary first: its side wins the fight for the free space; the
// extras then avoid what is already placed.
if (hasChild(primaryId)) {
final childSize = layoutChild(primaryId, constraints);
final offset = placeTooltip(
screen: screenLocal,
hole: holeLocal,
position: primaryPosition,
size: childSize,
safeArea: safeArea,
avoid: avoid,
gap: gap,
);
avoid.add(offset & childSize);
positionChild(primaryId, offset);
}
for (var i = 0; i < extraPositions.length; i++) {
final id = extraId(i);
if (!hasChild(id)) continue;
final childSize = layoutChild(id, constraints);
final offset = placeTooltip(
screen: screenLocal,
hole: holeLocal,
position: extraPositions[i],
size: childSize,
safeArea: safeArea,
avoid: avoid,
gap: gap,
);
avoid.add(offset & childSize);
positionChild(id, offset);
}
}