didChangeDependencies method

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

This method is also called immediately after initState. Otherwise called only if this State object's Widget is a dependency of InheritedWidget. When a InheritedWidget's build() function is called the dependent widget's build() function is also called but not before their didChangeDependencies() function. Subclasses rarely use this method.

Implementation

@override
@mustCallSuper
void didChangeDependencies() {
  super.didChangeDependencies();
  // Subscribe this to be informed about changes to route.
  _appState?.subscribe(this);
}