onDestroy method

  1. @override
void onDestroy()
override

Implementation

@override
void onDestroy() {
  assert(() {
    if (_ticker == null || !_ticker!.isActive) {
      return true;
    }
    throw FlutterError.fromParts(<DiagnosticsNode>[
      ErrorSummary('$this was disposed with an active Ticker.'),
      ErrorDescription(
        '$runtimeType created a Ticker via its SingleTickerProviderStateMixin, but at the time '
        'dispose() was called on the mixin, that Ticker was still active. The Ticker must '
        'be disposed before calling super.dispose().',
      ),
      ErrorHint(
        'Tickers used by AnimationControllers '
        'should be disposed by calling dispose() on the AnimationController itself. '
        'Otherwise, the ticker will leak.',
      ),
      _ticker!.describeForError('The offending ticker was'),
    ]);
  }());
  _tickerModeNotifier?.removeListener(_updateTicker);
  _tickerModeNotifier = null;
  super.onDestroy();
}