getHighlightPosition method

  1. @override
Position getHighlightPosition(
  1. BuildContext context,
  2. BubbleShowcase bubbleShowcase,
  3. int currentSlideIndex
)
override

Returns the position to highlight.

Implementation

@override
Position getHighlightPosition(
  BuildContext context,
  BubbleShowcase bubbleShowcase,
  int currentSlideIndex,
) {
  RenderBox renderBox =
      widgetKey.currentContext!.findRenderObject() as RenderBox;
  Offset offset = renderBox.localToGlobal(Offset.zero);

  return Position(
    top: offset.dy - highlightPadding,
    right: offset.dx + renderBox.size.width + highlightPadding,
    bottom: offset.dy + renderBox.size.height + highlightPadding,
    left: offset.dx - highlightPadding,
  );
}