didChangeDependencies method
Called when a dependency of this State object changes.
This method is also called immediately after initState
.
Implementation
@protected
@override
@mustCallSuper
void didChangeDependencies() {
/// No 'setState()' functions are allowed to fully function at this point.
_rebuildAllowed = false;
for (final listener in _beforeList) {
listener.didChangeDependencies();
}
for (final con in _controllerList) {
con.didChangeDependencies();
}
for (final listener in _afterList) {
listener.didChangeDependencies();
}
super.didChangeDependencies();
_rebuildAllowed = true;
if (_rebuildRequested && !_firstBuild) {
_rebuildRequested = false;
/// Perform a 'rebuild' if requested.
refresh();
}
/// Not the first build now.
_firstBuild = false;
}