clearAnimateToHandler method

void clearAnimateToHandler(
  1. Object token
)

Clears the animation handler only if it was set by the same token.

This prevents race conditions where an old widget's dispose clears a handler that was already replaced by a new widget.

Implementation

void clearAnimateToHandler(Object token) {
  if (_animateToHandlerToken == token) {
    _onAnimateToViewport = null;
    _animateToHandlerToken = null;
  }
}