You can use the GlobalKey to obtain the RenderBox from which you can get the size and offset position information . First, you need to assign a GlobalKey to the widget. If you’ve assigned the GlobalKey to the widget, you can get the currentContext property of the key and call the findRenderObject() method.
Read moreHow do you get widgets on Flutter?
To locate widgets in a test environment, use the Finder classes.
Read more