LineMetrics class Null safety

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({required bool hardBreak, required double ascent, required double descent, required double unscaledAscent, required double height, required double width, required double left, required double baseline, required 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
hashCode int
The hash code for this object.
read-onlyoverride
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
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
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

Methods

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

Operators

operator ==(Object other) bool
The equality operator.
override