Closed otaku011 closed 3 years ago
i have pinpointed the cause of this issue it's cause of styling in the iframe
<iframe width="640" height="360" src="https://www.youtube.com/embed/Sn7SVYn6ut8" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" style="position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;"></iframe>
any solutions for this???
Which version of the package are you using? This is a bug but it has been fixed in the latest release already I think.
i am using flutter_widget_from_html: ^0.5.1
try with the iframe code whichi have provided. this error will pop up
v0.5.1+1
has been released with the fix for this. Please try upgrading and see if it works for you.
yes thank you the issue has been fixed.
I am getting infinite height issue for this html code when i use the flutter_widget_from_html package .. but it works fine when using the core package..
Also is there any way to render iframe when using the core package. And is it possible to get links of img tag from the "data-src" attribute instead of the default "src" attributes?
`════════ Exception caught by rendering library ═════════════════════════════════════════════════════ The following assertion was thrown during performLayout(): BoxConstraints forces an infinite height.
These invalid constraints were provided to RenderAspectRatio's layout() function by the following function, which probably computed the invalid constraints in question: _RenderCssSizing.performLayout (package:flutter_widget_from_html_core/src/widgets/css_sizing.dart:175:11) The offending constraints were: BoxConstraints(w=434.7, h=Infinity) The relevant error-causing widget was: HtmlWidget file:///D:/Android/AndroidProjects/Main%20Projects/news_detailed_screen.dart:205:36 When the exception was thrown, this was the stack:
0 BoxConstraints.debugAssertIsValid..throwError (package:flutter/src/rendering/box.dart:517:9)
1 BoxConstraints.debugAssertIsValid. (package:flutter/src/rendering/box.dart:561:21)
2 BoxConstraints.debugAssertIsValid (package:flutter/src/rendering/box.dart:565:6)
3 RenderObject.layout (package:flutter/src/rendering/object.dart:1677:24)
4 _RenderCssSizing.performLayout (package:flutter_widget_from_html_core/src/widgets/css_sizing.dart:175:11)
... The following RenderObject was being processed when the exception was fired: _RenderCssSizing#a07cb relayoutBoundary=up13 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE ... parentData: (can use size)
... constraints: BoxConstraints(w=434.7, 0.0<=h<=Infinity)
... size: MISSING
RenderObject: _RenderCssSizing#a07cb relayoutBoundary=up13 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
parentData: (can use size)
constraints: BoxConstraints(w=434.7, 0.0<=h<=Infinity)
size: MISSING
... child: RenderAspectRatio#72363 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData:
... constraints: MISSING
... size: MISSING
... aspectRatio: 1.8
... child: RenderPointerListener#8ea84 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData:
... constraints: MISSING
... size: MISSING
... behavior: deferToChild
... listeners: down
... child: RenderSemanticsAnnotations#3a800 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
... parentData:
... constraints: MISSING
... size: MISSING
... child: RenderAndroidView#917ae NEEDS-LAYOUT NEEDS-PAINT
... needs compositing
... parentData:
... constraints: MISSING
... semantic boundary
... size: MISSING
════════════════════════════════════════════════════════════════════════════════════════════════════
`
Am trying to render this HTML code