forward method

TickerFuture forward(
  1. {double? from}
)

Starts running this animation forwards (towards the end).

Returns a TickerFuture that completes when the animation is complete.

The most recently returned TickerFuture, if any, is marked as having been canceled, meaning the future never completes and its TickerFuture.orCancel derivative future completes with a TickerCanceled error.

During the animation, status is reported as AnimationStatus.forward, which switches to AnimationStatus.completed when upperBound is reached at the end of the animation.

Implementation

TickerFuture forward({ double? from }) {
  assert(() {
    if (duration == null) {
      throw FlutterError(
        'AnimationController.forward() called with no default duration.\n'
        'The "duration" property should be set, either in the constructor or later, before '
        'calling the forward() function.',
      );
    }
    return true;
  }());
  assert(
    _ticker != null,
    'AnimationController.forward() called after AnimationController.dispose()\n'
    'AnimationController methods should not be used after calling dispose.',
  );
  _direction = _AnimationDirection.forward;
  if (from != null) {
    value = from;
  }
  return _animateToInternal(upperBound);
}