Open MarcVanDaele90 opened 2 years ago
This is apparently triggered by https://github.com/flutter/flutter/issues/65940
I have a temporary workaround (which is inefficient and probably incomplete but it might be helpful to others).
I replaced textpainter.didExceedMaxLines
with
final textPainter2 = TextPainter(
text: text,
textAlign: widget.textAlign ?? TextAlign.left,
textDirection: widget.textDirection ?? TextDirection.ltr,
textScaleFactor: scale,
maxLines: maxLines==null?maxLines:maxLines+1,
locale: widget.locale,
strutStyle: widget.strutStyle,
);
textPainter2.layout(maxWidth: constraints.maxWidth);
bool didExceedMaxLines = textPainter2.height>textPainter.height;
This fixes the issue on my side (note that I didn't touch wordWrapTextPainter
because I didn't need this right now)
It seems flutter/engine#34085 PR did fix the issue it is available in Flutter 3.7.0 stable release.
Steps to Reproduce
flutter build web
The code below runs fine
Code sample
Screenshots If applicable, add screenshots to help explain your problem. Screenshot added from linux chrome browser and Android chrome browser. Same problem is observed on iOS/Chrome+safari
Version