didChangeTextScaleFactor method
Called when the platform's text scale factor changes.
Implementation
@protected
@override
@mustCallSuper
void didChangeTextScaleFactor() {
///
/// This typically happens as the result of the user changing system
/// preferences, and it should affect all of the text sizes in the
/// application.
///
/// This method exposes notifications from [Window.onTextScaleFactorChanged].
/// See sample code below. No need to call super if you override.
/// @override
/// void didChangeTextScaleFactor() {
/// setState(() { _lastTextScaleFactor = ui.window.textScaleFactor; });
/// }
// A triggered system event
_hadSystemEvent = true;
/// No 'setState()' functions are allowed to fully function at this point.
_setStateAllowed = false;
for (final listener in _beforeList) {
listener.didChangeTextScaleFactor();
}
for (final con in _controllerList) {
con.didChangeTextScaleFactor();
}
for (final listener in _afterList) {
listener.didChangeTextScaleFactor();
}
_setStateAllowed = true;
if (_setStateRequested) {
_setStateRequested = false;
// Only the latest State is rebuilt
if (isEndState) {
/// Perform a 'rebuild' if requested.
setState(() {});
}
}
}