getWidgetPosition function

Offset getWidgetPosition(
  1. GlobalKey<State<StatefulWidget>> key
)

Implementation

Offset getWidgetPosition(GlobalKey key) {
  RenderBox box = key.currentContext!.findRenderObject() as RenderBox;
  return box.localToGlobal(Offset.zero);
}