void stop()

Stops calling this Ticker's callback.

Causes the future returned by start to resolve.

Calling this sets isActive to false.

This method does nothing if called when the ticker is inactive.

By convention, this method is used by the object that receives the ticks (as opposed to the TickerProvider which created the ticker).

Source

void stop() {
  if (!isTicking)
    return;

  // We take the _completer into a local variable so that isTicking is false
  // when we actually complete the future (isTicking uses _completer to
  // determine its state).
  Completer<Null> localCompleter = _completer;
  _completer = null;
  _startTime = null;
  assert(!isTicking);

  unscheduleTick();
  localCompleter.complete();
}