lineHeightScaleFactorOverride property
The system-suggested height of the text, as a multiple of the font size.
This value takes precedence over any text height specified at the application level. For example, at framework level, in the TextStyle for Text, SelectableText, and EditableText widgets, this value overrides the existing value of TextStyle.height and StrutStyle.height.
Returns null when no override has been set by the system.
Defaults to the value provided by PlatformDispatcher.lineHeightScaleFactorOverride. This can only be set in a test environment to emulate different platform configurations. A standard PlatformDispatcher is not mutable from the framework.
Setting this value to null will force lineHeightScaleFactorOverride to return
null. If you want to have the value default to the platform
lineHeightScaleFactorOverride, use clearLineHeightScaleFactorOverrideTestValue.
See also:
- PlatformDispatcher.lineHeightScaleFactorOverride for the standard implementation
- clearLineHeightScaleFactorOverrideTestValue to reset this value specifically
- clearAllTestValues to reset all test values for this view
Implementation
@override
double? get lineHeightScaleFactorOverride => _forceLineHeightScaleFactorOverrideToBeNull
? null
: _lineHeightScaleFactorOverrideTestValue ??
_platformDispatcher.lineHeightScaleFactorOverride;