paint method

  1. @override
String paint()
override

Implementation

@override
String paint() {
  final wrapped = _wrappedText ?? text;
  final maxW = size.width.toInt();
  final textW = Layout.getWidth(wrapped);
  if (textW <= maxW) return wrapped;
  // Clip lines that exceed the constrained width (hard truncation, no
  // ellipsis).  This mirrors Flutter's behaviour where paint output is
  // clipped to the widget's reported size.
  return wrapped
      .split('\n')
      .map((l) => Layout.truncate(l, maxW, ellipsis: ''))
      .join('\n');
}