stop method
- 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:
- reset, which stops the animation and resets it to the lowerBound, and which does send notifications.
- forward, reverse, animateTo, animateWith, fling, and repeat, which restart the animation controller.
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);
}