maxLines property

int? maxLines
final

Maximum number of lines for the label text.

If the text exceeds this number of lines when wrapping, it will be truncated. Set to null (default) for unlimited lines.

This works together with maxWidth to control text wrapping and overflow.

Example:

maxLines: 2  // Text limited to 2 lines
maxLines: null  // Unlimited lines (default)

Implementation

final int? maxLines;