launchTo method

TickerFuture launchTo(
  1. double from,
  2. double? to, {
  3. double velocity = 1.0,
  4. AnimationBehavior? animationBehavior,
})

Implementation

TickerFuture launchTo(double from, double? to,
    {double velocity = 1.0, AnimationBehavior? animationBehavior}) {
  double scale = 1.0;
  final AnimationBehavior behavior =
      animationBehavior ?? this.animationBehavior;
  if (SemanticsBinding.instance.disableAnimations) {
    switch (behavior) {
      case AnimationBehavior.normal:
        scale = 200.0;
        break;
      case AnimationBehavior.preserve:
        break;
    }
  }

  final Simulation simulation =
      SpringSimulation(_springDescription, from, to!, velocity * scale)
        ..tolerance = _kFlingTolerance;
  return animateWith(simulation);
}