textScaleFactor property
double
textScaleFactor
The number of font pixels for each logical pixel.
For example, if the text scale factor is 1.5, text will be 50% larger than the specified font size.
See also:
- MediaQuery.textScaleFactorOf, a convenience method which returns the textScaleFactor defined for a BuildContext.
Implementation
double get textScaleFactor {
if (_context == null) throw NoContextException();
try {
_mediaQuery = MediaQuery.maybeOf(_context!);
if (_mediaQuery == null) throw NoContextException();
return _mediaQuery!.textScaleFactor;
} catch (e) {
throw NoContextException();
}
}