preferredLineWidth property

double preferredLineWidth

The width of a space in text in logical pixels.

(This is in vertical orientation. In other words, it is the height of a space in horizontal orientation.)

Not every line of text in text will have this width, but this width is "typical" for text in text and useful for sizing other objects relative a typical line of text.

Obtaining this value does not require calling layout.

The style of the text property is used to determine the font settings that contribute to the preferredLineWidth. If text is null or if it specifies no styles, the default TextStyle values are used (a 10 pixel sans-serif font).

Implementation

double get preferredLineWidth =>
    (_layoutTemplate ??= _createLayoutTemplate()).width;