TextLeadingDistribution enum Null safety

How the "leading" is distributed over and under the text.

Does not affect layout when TextStyle.height is not specified. The leading can become negative, for example, when TextLeadingDistribution.even is used with a TextStyle.height much smaller than 1.0.

Constants

even → const TextLeadingDistribution

Distributes the "leading" of the text evenly above and below the text (i.e. evenly above the font's ascender and below the descender).

The leading of a text run is defined as TextStyle.height * TextStyle.fontSize - TextStyle.fontSize. When TextStyle.height is not set, the text run uses the leading specified by the font instead.

The leading can become negative when TextStyle.height is smaller than 1.0.

This is the default strategy used by CSS, known as "half-leading".

const TextLeadingDistribution(1)
proportional → const TextLeadingDistribution

Distributes the leading of the text proportionally above and below the text, to the font's ascent/discent ratio.

The leading of a text run is defined as TextStyle.height * TextStyle.fontSize - TextStyle.fontSize. When TextStyle.height is not set, the text run uses the leading specified by the font instead.

const TextLeadingDistribution(0)
values → const List<TextLeadingDistribution>

A constant List of the values in this enum, in order of their declaration.

const List<TextLeadingDistribution>

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
index int

The integer index of this enum.

final
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
A string representation of this object. [...]
override

Operators

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