SingleSpringController constructor

SingleSpringController({
  1. required TickerProvider vsync,
  2. required SpringDescription spring,
  3. double initialValue = 0.0,
  4. double? lowerBound,
  5. double? upperBound,
})

Creates a SingleSpringController.

  • vsync: the TickerProvider that drives the animation (typically your State with SingleTickerProviderStateMixin).
  • spring: the spring description. Can be changed at any time.
  • initialValue: the starting value before any animateTo is called.
  • lowerBound / upperBound: optional clamping; mirrors BoundedSingleMotionController.

Implementation

SingleSpringController({
  required TickerProvider vsync,
  required SpringDescription spring,
  double initialValue = 0.0,
  double? lowerBound,
  double? upperBound,
})  : _spring = spring,
      _value = initialValue,
      _lowerBound = lowerBound,
      _upperBound = upperBound {
  _ticker = vsync.createTicker(_tick);
}