How to find the size or position of any widget in flutter?
RenderBox renderbox =
widgetKey.currentContext!.findRenderObject() as RenderBox;
Offset position = renderbox.localToGlobal(Offset.zero);
double x = position.dx;
double y = position.dy;
debugPrint([x, y].toString());
final Size size = renderbox.size;
debugPrint(size.toString());
Here, widgetKey is the GlobalKey assigned to the widget of which size and position we have to find the size and position.
x and y denotes the coordinates of the top left point.
All other coordinates can be find out by using size. Size has height and width. e.g. x+size.width, y-size.height