SingleSpringController constructor
SingleSpringController({
- required TickerProvider vsync,
- required SpringDescription spring,
- double initialValue = 0.0,
- double? lowerBound,
- 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; mirrorsBoundedSingleMotionController.
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);
}