Sprung.custom constructor

Sprung.custom({
  1. double damping = 20,
  2. double stiffness = 180,
  3. double mass = 1.0,
  4. double velocity = 0.0,
})

Provides a critically damped spring by default, with an easily overrideable damping, stiffness and mass value.

Implementation

Sprung.custom({
  double damping = 20,
  double stiffness = 180,
  double mass = 1.0,
  double velocity = 0.0,
}) : this._sim = SpringSimulation(
        SpringDescription(
          damping: damping,
          mass: mass,
          stiffness: stiffness,
        ),
        0.0,
        1.0,
        velocity,
      );