changedInternalState method
override
Called whenever the internal state of the route has changed.
This should be called whenever willHandlePopInternally, didPop, ModalRoute.offstage, or other internal state of the route changes value. It is used by ModalRoute, for example, to report the new information via its inherited widget to any children of the route.
See also:
- changedExternalState, which is called when the Navigator has updated in some manner that might affect the routes.
Implementation
@override
void changedInternalState() {
super.changedInternalState();
// No need to mark dirty if this method is called during build phase.
if (SchedulerBinding.instance.schedulerPhase != SchedulerPhase.persistentCallbacks) {
setState(() { /* internal state already changed */ });
_modalBarrier.markNeedsBuild();
}
_modalScope.maintainState = maintainState;
}