TextHeightBehavior constructor Null safety

const TextHeightBehavior(
  1. {bool applyHeightToFirstAscent = true,
  2. bool applyHeightToLastDescent = true,
  3. TextLeadingDistribution leadingDistribution = TextLeadingDistribution.proportional}
)

Creates a new TextHeightBehavior object.

  • applyHeightToFirstAscent: When true, the TextStyle.height modifier will be applied to the ascent of the first line. When false, the font's default ascent will be used.
  • applyHeightToLastDescent: When true, the TextStyle.height modifier will be applied to the descent of the last line. When false, the font's default descent will be used.
  • leadingDistribution: How the leading is distributed over and under text.

All properties default to true (height modifications applied as normal).

Implementation

const TextHeightBehavior({
  this.applyHeightToFirstAscent = true,
  this.applyHeightToLastDescent = true,
  this.leadingDistribution = TextLeadingDistribution.proportional,
});