Animation In Flutter : AnimatedAlign
Animate the position of any widget with ease.

Search for a command to run...
Animate the position of any widget with ease.

No comments yet. Be the first to comment.
Lessons from Code, Content, and Consistency

Reliability basics: Outbox pattern + why it matters

Introducing Kafka/Redpanda + move to event-driven workflow

Connect Orders โ Inventory (first working service-to-service flow)

Inventory service + gRPC + proto contracts


AnimatedAlign(
child: Container(...)
)
starting alignment and ending alignment to the alignment property of the AnimatedWidget.AnimatedAlign(
alignment: animatePosition ? resultAlignment : currentAlignment,
child: Container(...)
)
duration to the duration property, which determines for how long the animation should run.AnimatedAlign(
alignment: alignment: animatePosition ? resultAlignment : currentAlignment,
duration: const Duration(seconds: 1),
child: Container(...)
)
AnimatedAlign(
alignment: alignment: animatePosition ? resultAlignment : currentAlignment,
duration: const Duration(seconds: 1),
curve: Curves.fastOutSlowIn,
child: Container(...)
)

animatePosition, which is used to notify the AnimatedAlign widget that the user has clicked on the button to animate the position of the widget, So animate that widget's position from currentPosition to resultantPosition.
One more thing is, as you can see in the first example, As soon as I trigger other animation while the previous animation is still running, the previous animation stopped and continue its animation with a new animation value. How cool is that !!!
