Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Transform translate a widget from current position to another position

If I want to translate any Widget in my flutter app, I will use below code.

Transform.translate()

Translate function required Offset (dx,dy). But I want to find dx or dy value of the current widget so I can slightly move widget to left and right or top and bottom from the current position on device.

like image 816
Developine Avatar asked Feb 03 '26 08:02

Developine


1 Answers

That's how it works

If I do

Transform.translate(offset: Offset(-10, 20)

It's transform its position 10 to the left and 20 down from its normal render position.

like image 186
Andrew Avatar answered Feb 06 '26 10:02

Andrew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!