wordSpacingOverride property
The system-suggested amount of additional space (in logical pixels) to add between each sequence of white-space (i.e. between each word).
A negative value can be used to bring the words closer.
This value takes precedence over any text word spacing 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.wordSpacing.
Returns null when no override has been set by the system.
Defaults to the value provided by PlatformDispatcher.wordSpacingOverride. 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 wordSpacingOverride to return
null. If you want to have the value default to the platform
wordSpacingOverride, use clearWordSpacingOverrideTestValue.
See also:
- PlatformDispatcher.wordSpacingOverride for the standard implementation
- clearWordSpacingOverrideTestValue to reset this value specifically
- clearAllTestValues to reset all test values for this view
Implementation
@override
double? get wordSpacingOverride => _forceWordSpacingOverrideToBeNull
? null
: _wordSpacingOverrideTestValue ?? _platformDispatcher.wordSpacingOverride;