getPositions static method

dynamic getPositions(
  1. GlobalKey<State<StatefulWidget>> key
)

Implementation

static getPositions(GlobalKey key) {
  final RenderBox? renderBox = key.currentContext?.findRenderObject() as RenderBox?;
  final position = renderBox?.localToGlobal(Offset.zero);
  // print("POSITION: $position ");
  return [position?.dx, position?.dy];
}