deactivate method
The framework calls this method whenever it removes this StateX
object
from the tree. In many cases, it is about to be 'disposed of'.
Implementation
@override
void deactivate() {
_errorHandler?.deactivate();
super.deactivate(); // IMPORTANT to call last
}