animateWith method

TickerFuture animateWith (Simulation simulation)

Drives the animation according to the given simulation.

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.

Implementation

TickerFuture animateWith(Simulation simulation) {
  assert(
    _ticker != null,
    'AnimationController.animateWith() called after AnimationController.dispose()\n'
    'AnimationController methods should not be used after calling dispose.'
  );
  stop();
  return _startSimulation(simulation);
}