forward method
Starts animating forward (toward upperBound).
Returns a Cmd that schedules the first animation frame tick.
The hosting State must return this Cmd from handleInit or
handleUpdate.
If from is provided the controller jumps to that value before
animating. The optional curve defaults to Curves.linear.
When duration is null or Duration.zero, the animation completes
synchronously and processTick is not required.
Implementation
Cmd forward({double? from, Curve curve = Curves.linear}) {
if (from != null) _value = from.clamp(lowerBound, upperBound);
_targetValue = upperBound;
_startValue = _value;
_curve = curve;
_status = AnimationStatus.forward;
_startTime = null;
_repeating = false;
_notifyStatusListeners();
if (duration == null || duration == Duration.zero) {
_value = _targetValue;
_completeAnimation();
return Cmd.none();
}
return _scheduleTick();
}