globalOffsetToLocal static method

Offset? globalOffsetToLocal(
  1. GlobalKey<State<StatefulWidget>> key,
  2. Offset offsetGlobal
)

Implementation

static Offset? globalOffsetToLocal(GlobalKey key, Offset offsetGlobal) {
  RenderBox renderObject =
      key.currentContext?.findRenderObject() as RenderBox;
  if (renderObject == null) {
    return null;
  }
  return renderObject.globalToLocal(offsetGlobal);
}