您可以
GlobalKey用来获取小部件的大小或位置
GlobalKey key = GlobalKey();Container(key: key,...); //add key to your widget, which position you need to findRenderBox box = key.currentContext.findRenderObject();Offset position = box.localToGlobal(Offset.zero); //this is global positiondouble y = position.dy; //this is y - I think it's what you want



