flutter_html_iframe 3.0.0-beta.2 copy "flutter_html_iframe: ^3.0.0-beta.2" to clipboard
flutter_html_iframe: ^3.0.0-beta.2 copied to clipboard

This extension package allows the <iframe> tag to be rendered using the flutter_html package

flutter_html_iframe #

Iframe widget for flutter_html.

This package renders iframes using the webview_flutter plugin.

When rendering iframes, the package considers the width, height, and sandbox attributes.

Sandbox controls the JavaScript mode of the webview - a value of null or allow-scripts will set javascriptMode: JavascriptMode.unrestricted, otherwise it will set javascriptMode: JavascriptMode.disabled.

Registering the CustomRender:

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

You can set the navigationDelegate of the webview with the navigationDelegate property on iframeRender. This allows you to block or allow the loading of certain URLs.

Widget html = Html(
  customRenders: {
    iframeMatcher(): iframeRender(navigationDelegate: (NavigationRequest request) {
      if (request.url.contains("google.com/images")) {
        return NavigationDecision.prevent;
      } else {
        return NavigationDecision.navigate;
      }
    }),
  }
);
8
likes
130
pub points
93%
popularity

Publisher

verified publishersub6resources.com

This extension package allows the <iframe> tag to be rendered using the flutter_html package

Repository (GitHub)
View/report issues
Contributing

Topics

#html #css #iframe #layout #flutter_html

Documentation

API reference

Funding

Consider supporting this project:

opencollective.com

License

MIT (LICENSE)

Dependencies

flutter, flutter_html, html, webview_flutter

More

Packages that depend on flutter_html_iframe