Sub6Resources / flutter_html

A Flutter widget for rendering static html as Flutter widgets (Will render over 80 different html tags!)
https://pub.dev/packages/flutter_html
MIT License
1.79k stars 860 forks source link

[BUG] Error with multiple <p> with html renderer #1192

Closed sdabet-orpheo closed 1 year ago

sdabet-orpheo commented 1 year ago

Describe the bug: When the html content contains more than one <p> the rendering raises an exception on Android devices with html web renderer.

HTML to reproduce the issue:

<p>test</p><p>test</p>

Html widget configuration:

Html(data: "<p>test</p><p>test</p>")

Expected behavior: Both paragraphs should be displayed

Device details and Flutter/Dart/flutter_html versions: Samsung A50 with Chrome 103 and Android 9, flutter_html 3.0.0-alpha6

Stacktrace/Logcat

NoSuchMethodError: method not found: 'start' on null
     at LineBuilder._popSegment$0 
     at LineBuilder.revertToLastBreakOpportunity$0
     at TextLayoutService.performLayout$1
     at CanvasParagraph.layout$1
     at TextPainter._layoutParagraph$2 
     at TextPainter.layout$2$maxWidth$minWidth
     at RenderParagraph._layoutText$2$maxWidth$minWidth
     at RenderParagraph._layoutTextWithConstraints$1
     at RenderParagraph.performLayout$0
     at RenderParagraph.layout$2$parentUsesSize
erickok commented 1 year ago

Please let us know the version of flutter_html you are using.

sdabet-orpheo commented 1 year ago

Yes, sorry, this is 3.0.0-alpha6

Sub6Resources commented 1 year ago

Not able to reproduce (with --web-renderer html on Pixel 6 (Android 14) Chrome 113)