Animate a page route transition

Animate the properties of a container

Animate a widget using a physics simulation

Cookbook

Animation

Animate a widget using a physics simulation

Step 1: Set up an animation controller

Step 2: Move the widget using gestures

Step 3: Animate the widget

Step 4: Calculate the velocity to simulate a springing motion

Interactive Example

Physics simulations can make app interactions feel realistic and interactive.
For example, you might want to animate a widget to act as if it were attached to
a spring or falling with gravity.

This recipe demonstrates how to move a widget from a dragged point back to the
center using a spring simulation.

This recipe uses these steps:

Set up an animation controller

Move the widget using gestures

Animate the widget