ellipsis property Null safety

String? ellipsis

The string used to ellipsize overflowing text. Setting this to a non-empty string will cause this string to be substituted for the remaining text if the text can not fit within the specified maximum width.

Specifically, the ellipsis is applied to the last line before the line truncated by maxLines, if maxLines is non-null and that line overflows the width constraint, or to the first line that is wider than the width constraint, if maxLines is null. The width constraint is the maxWidth passed to layout.

After this is set, you must call layout before the next call to paint.

The higher layers of the system, such as the Text widget, represent overflow effects using the TextOverflow enum. The TextOverflow.ellipsis value corresponds to setting this property to U+2026 HORIZONTAL ELLIPSIS (…).

Implementation

String? get ellipsis => _ellipsis;
void ellipsis=(String? value)

Implementation

set ellipsis(String? value) {
  assert(value == null || value.isNotEmpty);
  if (_ellipsis == value)
    return;
  _ellipsis = value;
  markNeedsLayout();
}