getWidgetLocalToGlobal method

Offset getWidgetLocalToGlobal({
  1. Offset point = Offset.zero,
  2. RenderObject? ancestor,
})

Get the coordinates of the widget on the screen.Widgets must be rendered completely. 获取widget在屏幕上的坐标,widget必须渲染完成

Implementation

Offset getWidgetLocalToGlobal(
    {Offset point = Offset.zero, RenderObject? ancestor}) {
  final RenderBox? box = getRenderBox;
  return box == null
      ? Offset.zero
      : box.localToGlobal(point, ancestor: ancestor);
}