First, import the physics package:

The onPanEnd callback provides a DragEndDetails object. This object
provides the velocity of the pointer when it stopped contacting the screen. The
velocity is in pixels per second, but the Align widget doesn’t use pixels. It
uses coordinate values between [-1.0, -1.0] and [1.0, 1.0], where [0.0, 0.0]
represents the center. The size calculated in step 2 is used to convert pixels
to coordinate values in this range.

Finally, AnimationController has an animateWith() method that can be given a
SpringSimulation:

Don’t forget to call _runAnimation()  with the velocity and size:

Note:
  Now that the animation controller uses a simulation it’s duration argument
  is no longer required.

Interactive Example

Animate a page route transition

Animate the properties of a container