deactivate method

  1. @protected
  2. @mustCallSuper
void deactivate()

Called when this state's element is removed from the tree, either permanently (followed by dispose) or temporarily — when a widget with a GlobalKey is moved to a new parent in the same build, the element is deactivated here and reactivated via activate once the new parent claims it.

Override to release resources that must not outlive the element's current tree position (e.g. unregister from a service), pairing the teardown with activate. The default is a no-op.

Implementation

@protected
@mustCallSuper
void deactivate() {}