changedExternalState method
- @override
override
Called whenever the Navigator has its widget rebuilt, to indicate that the route may wish to rebuild as well.
This is called by the Navigator whenever the NavigatorState's
widget
changes, for example because the MaterialApp has been rebuilt.
This ensures that routes that directly refer to the state of the widget
that built the MaterialApp will be notified when that widget rebuilds,
since it would otherwise be difficult to notify the routes that state they
depend on may have changed.
See also:
- changedInternalState, the equivalent but for changes to the internal state of the route.
Implementation
@override
void changedExternalState() {
super.changedExternalState();
if (_scopeKey.currentState != null)
_scopeKey.currentState._forceRebuildPage();
}