didHaveMemoryPressure method
Called when the system is running low on memory.
Implementation
@override
@mustCallSuper
void didHaveMemoryPressure() {
// A triggered system event
_hadSystemEvent = true;
// Don't if the State object is defunct.
if (!mounted) {
return;
}
///
/// This method exposes the `memoryPressure` notification from
/// [SystemChannels.system].
/// No 'setState()' functions are allowed to fully function at this point.
_setStateAllowed = false;
for (final con in controllerList) {
con.didHaveMemoryPressure();
}
_setStateAllowed = true;
if (_setStateRequested) {
_setStateRequested = false;
// Only the latest State is rebuilt
if (isLastState) {
/// Perform a 'rebuild' if requested.
setState(() {});
}
}
}