settleTo method

  1. @protected
TickerFuture settleTo(
  1. double target, {
  2. double? velocity,
})

Implementation

@protected
TickerFuture settleTo(double target, {double? velocity}) {
  final controller = this.controller!;
  final from = controller.value;
  final opens = target == 1;
  final simulation = SpringSimulation(
    opens ? openSpring : closeSpring,
    from,
    target,
    velocity ??
        (target - from) * (opens ? openLaunchSpeed : closeLaunchSpeed),
    tolerance: _settleTolerance,
    snapToEnd: true,
  );
  final settle = ArrivingSimulation(simulation, end: target);
  return opens
      ? controller.animateWith(settle)
      : controller.animateBackWith(settle);
}