flutter text省略号

修改源码:
case TextOverflow.ellipsis:
  assert(textDirection != null);
  _needsClipping = true;
  final TextPainter fadeSizePainter = TextPainter(
    text: TextSpan(style: _textPainter.text.style, text: '\u2026'),
    textDirection: textDirection,
    textScaleFactor: textScaleFactor,
    locale: locale,
  )..layout();
  if (!didOverflowWidth){
    final double fadeEnd = size.height;
    final int lines = fadeEnd~/fadeSizePainter.height;
    _textPainter.maxLines = lines;
  }

  _overflowShader = null;
  break;

你可能感兴趣的:(flutter text省略号)