detachState method
Detaches the controller from state, if it is the one attached.
This is called internally when the SpinnerWheel is disposed or
switches to a different controller.
Implementation
void detachState(SpinnerWheelState state) {
if (identical(_state, state)) {
_state = null;
if (_isSpinning) {
_isSpinning = false;
// Detaching happens while the widget tree is being torn down, where
// listeners must not call setState. Tell them afterwards.
scheduleMicrotask(_notifyIfAlive);
}
}
}