getPositionForChild method

  1. @override
Offset getPositionForChild(
  1. Size size,
  2. Size childSize
)
override

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)',
  );
  return placeTooltip(
    screen: screenLocal,
    hole: holeLocal,
    position: position,
    size: childSize,
    safeArea: safeArea,
    avoid: [holeLocal, ...extraHoles],
    gap: gap,
  );
}