setState method
Allows 'external' routines to call this function.
Implementation
// Note not 'protected' and so can be called by 'anyone.' -gp
@override
void setState(VoidCallback fn) {
//
if (_setStateAllowed) {
//
_setStateAllowed = false;
// Don't bother if the State object is disposed of.
if (mounted) {
// Refresh the interface by 'rebuilding' the Widget Tree
// Call the State object's setState() function.
super.setState(fn);
assert(() {
if (_debugPrintEvents) {
debugPrint('$_consoleLeadingLine setState() in $this');
}
return true;
}());
}
_setStateAllowed = true;
} else {
// Can't rebuild at this moment but at least make the request.
_setStateRequested = true;
}
}