Somehow I'm getting same values for both, I'm not able to understand the difference between global and local position in flutter.
RenderBox getBox = context.findRenderObject();
Offset position = getBox.localToGlobal(Offset.zero);
var local = getBox.globalToLocal(update.globalPosition);
GlobalPosition is the coordinate of a point on-screen with the top-left corner of the screen as the origin. Whereas LocalPosition is the coordinates of a point inside a RenderBox with the top-left corner of the RenderBox as the origin. If you are getting the same value, it means that your RenderBox top-left corner is the same as the screen top-left corner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With