LineMetrics class

LineMetrics stores the measurements and statistics of a single line in the paragraph.

The measurements here are for the line as a whole, and represent the maximum extent of the line instead of per-run or per-glyph metrics. For more detailed metrics, see TextBox and Paragraph.getBoxesForRange.

LineMetrics should be obtained directly from the Paragraph.computeLineMetrics method.

Constructors

LineMetrics({bool hardBreak, double ascent, double descent, double unscaledAscent, double height, double width, double left, double baseline, int lineNumber})
Creates a LineMetrics object with only the specified values. [...]

Properties

ascent → double
The rise from the baseline as calculated from the font and style for this line. [...]
final
baseline → double
The y coordinate of the baseline for this line from the top of the paragraph. [...]
final
descent → double
The drop from the baseline as calculated from the font and style for this line. [...]
final
hardBreak → bool
True if this line ends with an explicit line break (e.g. '\n') or is the end of the paragraph. False otherwise.
final
height → double
Total height of the line from the top edge to the bottom edge. [...]
final
left → double
The x coordinate of left edge of the line. [...]
final
lineNumber → int
The number of this line in the overall paragraph, with the first line being index zero. [...]
final
unscaledAscent → double
The rise from the baseline as calculated from the font and style for this line ignoring the TextStyle.height. [...]
final
width → double
Width of the line from the left edge of the leftmost glyph to the right edge of the rightmost glyph. [...]
final
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited