stop method

void stop(
  1. {bool canceled = true}
)

Stops running this animation.

This does not trigger any notifications. The animation stops in its current state.

By default, the most recently returned TickerFuture is marked as having been canceled, meaning the future never completes and its TickerFuture.orCancel derivative future completes with a TickerCanceled error. By passing the canceled argument with the value false, this is reversed, and the futures complete successfully.

See also:

Implementation

void stop({ bool canceled = true }) {
  assert(
    _ticker != null,
    'AnimationController.stop() called after AnimationController.dispose()\n'
    'AnimationController methods should not be used after calling dispose.',
  );
  _simulation = null;
  _lastElapsedDuration = null;
  _ticker!.stop(canceled: canceled);
}