detach method

void detach()

Detaches from the TickerProvider, saving progress and state.

Call before the widget is disposed to preserve animation state.

Implementation

void detach() {
  if (_controller != null) {
    _savedProgress = _controller!.value;
    _wasAnimating = _controller!.isAnimating;
    _controller!.removeListener(_listener!);
    _controller!.stop();
    _listener = null;
  }
}