maxLines property

int? maxLines
final

An optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be resized according to the specified bounds and if necessary truncated according to overflow.

If this is 1, text will not wrap. Otherwise, text will be wrapped at the edge of the box.

If this is null, but there is an ambient DefaultTextStyle that specifies an explicit number for its DefaultTextStyle.maxLines, then the DefaultTextStyle value will take precedence. You can use a RichText widget directly to entirely override the DefaultTextStyle.

Implementation

final int? maxLines;