makeSpring static method

SpringSimulation makeSpring({
  1. required SpringDescription spring,
  2. required double from,
  3. required double to,
  4. double velocity = 0.0,
})

Creates a SpringSimulation from fromto using spring.

velocity carries the in-flight speed of the axis being retargeted. Passing it matters whenever a morph reverses before it settles — which scroll-driven minimizing makes routine, since scrolling down and straight back up is an ordinary gesture. Relaunching from rest in that case reads as a stall followed by a restart. Defaults to 0.0, which is what an idle AnimationController reports, so a first-launch spring is unchanged.

Implementation

static SpringSimulation makeSpring({
  required SpringDescription spring,
  required double from,
  required double to,
  double velocity = 0.0,
}) =>
    SpringSimulation(spring, from, to, velocity);