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] can't load iframe #1287

Open thienvu9884 opened 1 year ago

thienvu9884 commented 1 year ago

i can't load iframe in ^3.0.0-beta.1 version. IframeHtmlExtension() don't work in flutter_html: ^3.0.0-beta.1 version, but it work in 2.2.1 version. i can't use 2.2.1 version because it depends on other pakages.

Sub6Resources commented 1 year ago

What do you mean by it not working? Do you get an error? Does it fail to show anything? Does it just glitch?

xMISSJ commented 1 year ago

What do you mean by it not working? Do you get an error? Does it fail to show anything? Does it just glitch?

I have the same issue. Using exact the same version. There is no error, it just doesn't show anything.

So using the example code from documentation:

  Widget html = Html(
    data: """
   <h3>YouTube iframe:</h3>
   <iframe src="https://google.com"></iframe>
   <h3>Google iframe:</h3>
   <iframe src="https://www.youtube.com/embed/tgbNymZ7vqY"></iframe>
   """,
  );

Screenshot 2023-06-19 at 17 25 05

Downgrading to v2.2.1 isn't possible either, because I will get dependency issues just like OP.

Sub6Resources commented 1 year ago

@xMISSJ Did you include the IframeHtmlExtension?

xMISSJ commented 1 year ago

@xMISSJ Did you include the IframeHtmlExtension?

Good one, didn't do that! When added, it works as intended. Thank you!

For others facing the same issues, add this package: https://pub.dev/packages/flutter_html_iframe.

chrisvidal commented 1 year ago

added this package but i am having this other error on iOS:

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      WKWebViewConfigurationHostApi.create
web_kit.g.dart:1008
<asynchronous suspension>

the package mentions to do something like this:

Widget html = Html(
  customRenders: {
    iframeMatcher(): iframeRender(),
  }
);

but cant find where or how to implement this customRenders arguments. flutter_html 3 beta 2 does not support this argument

any idea please?

Roasted-Peanut commented 10 months ago

đã thêm gói này nhưng tôi gặp lỗi khác trên iOS:

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0      WKWebViewConfigurationHostApi.create
web_kit.g.dart:1008
<asynchronous suspension>

gói đề cập đến việc làm một cái gì đó như thế này:

Widget html = Html(
  customRenders: {
    iframeMatcher(): iframeRender(),
  }
);

nhưng không thể tìm thấy vị trí hoặc cách thực hiện customRendersđối số này. flutter_html 3 beta 2không ủng hộ lập luận này

có ý kiến ​​gì không?

same problem

sathishR-esf commented 10 months ago

Still this issue is there, There is no such argument in flutter_html: ^3.0.0-beta.2 customRenders

customRenders: { iframeMatcher(): iframeRender(), },