maxLines property

  1. @override
int? maxLines
override

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 truncated according to overflow and softWrap.

Implementation

@override
int? get maxLines => _textPainter.maxLines;
  1. @override
void maxLines=(int? value)
override

The value may be null. If it is not null, then it must be greater than zero.

Implementation

@override
set maxLines(int? value) {
  assert(value == null || value > 0);
  if (_textPainter.maxLines == value) return;
  _textPainter.maxLines = value;
  _overflowShader = null;
  markNeedsLayout();
}