set method

void set(
  1. double target, {
  2. bool instant = false,
})

Springs towards target, or jumps there when instant.

Implementation

void set(double target, {bool instant = false}) {
  _target = target;
  if (instant || reduceMotion) {
    _value = target;
    _velocity = 0;
    if (_ticker.isActive) _ticker.stop();
    notifyListeners();
    return;
  }
  if (_value == target && _velocity == 0) return;
  if (!_ticker.isActive) {
    _last = Duration.zero;
    _ticker.start();
  }
}