deactivate method

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

The framework calls this method whenever it removes this State object from the tree.

Implementation

@override
@mustCallSuper
void deactivate() {
  super.deactivate();
  // No longer informed about changes to its route.
  _appState?.unsubscribe(this);
}