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 in flutter_html_iframe #1152

Closed seljad closed 1 year ago

seljad commented 1 year ago

I'm using flutter_html: ^3.0.0-alpha.5 and when add iframeMatcher(): iframeRender() from flutter_html_iframe: ^3.0.0-alpha.3, I got this error message:

../../.pub-cache/hosted/pub.dartlang.org/flutter_html_iframe-3.0.0-alpha.3/lib/iframe_mobile.dart:15:12: Error: Method not found: 'ContainerSpan'. child: ContainerSpan( ^^^^^^^^^^^^^

I try to change the version of flutter_html to ^3.0.0-alpha.6 but nothing difference.

This is my full code for the Html widget:

return Html(
      data: data,
      onImageError: (exception, stackTrace) {},
      shrinkWrap: true,
      customRenders: {
        iframeMatcher(): iframeRender()
      },
      onLinkTap: (url, context, attributes, element) {
        openUrl(url);
      },
    );
chenghuaWang commented 1 year ago

This bug occured on my program too, after I upgrade some packages. Maybe there r just some API changes on ContainerSpan class ?

chenghuaWang commented 1 year ago

Using old version of flutter_html ^3.0.0-alpha.5 can fix it.

seljad commented 1 year ago

@chenghuaWang I check the _iframemobile.dart in _flutter_htmliframe folder:

Screenshot

As you see, the ContainerSpan is not found and I don't know why...

seljad commented 1 year ago

Using old version of flutter_html ^3.0.0-alpha.5 can fix it.

I'm using this version now, but still got that error

chenghuaWang commented 1 year ago

Maybe the dart package manager is still using another version of flutter_html ?

In my pubspec.yaml file, I setted the flutter_html <= 3.0.0-alpha.5.

seljad commented 1 year ago

Maybe the dart package manager is still using another version of flutter_html ?

In my pubspec.yaml file, I setted the flutter_html <= 3.0.0-alpha.5.

Unfortunately, my dart package manager had cache packages and used the ^3.0.0-alpha.6 version. I fix that and everything is ok now. But generally, it's a bug on the ^3.0.0-alpha.6 version.

Sub6Resources commented 1 year ago

Yes, this is a known issue. There was an update to all of the packages that included a breaking change, but only flutter_html was updated on pub.dev. We're still waiting for the sub-packages to be published. Please continue to use ^3.0.0-alpha.5 for now. Thanks for your patience!

cc @erickok: I sent an email about this 😃

Sub6Resources commented 1 year ago

@seljad @chenghuaWang, the new sub-package versions have been published, so you can begin again to use flutter_html 3.0.0-alpha.6 with the new versions.