Below are detailed guides for some of the supported HTML elements so you can make better use of available features and debug your app if you encounter problems.

You can use the onLinkTap callback to receive all interactions with <a> elements.

Html(
  data: '<a href="https://.com"></a>',
  onLinkTap: (url) {
    //Do something with url, e.g. launch(url);
  },
),

NOTE: <audio> requires that you add the package flutter_html_audio as a dependency.

Support for the <audio> tag is turned off by default. To enable it, add the flutter_html_audio package as a dependency and configure your Html widget:

Html(
  data: ...,
  extensions: [
    // Add this to your extensions
    AudioHtmlExtension(),
  ],
)

Renders a horizontal bar. <hr> is styled using the border property. See https://www.w3schools.com/howto/howto_css_style_hr.asp for more details. Other than only producing solid-style borders (no dashed or dotted), flutter_html fully supports the code example on that page.

NOTE: <iframe> requires that you add the package flutter_html_iframe as a dependency.

Support for the <iframe> tag is turned off by default. To enable it, add the flutter_html_iframe package as a dependency and configure your Html widget:

Html(
  data: ...,
  extensions: [
    // Add this to your extensions
    IframeHtmlExtension(),
  ],
)

Coming Soon!

NOTE: <math> requires that you add the package flutter_html_math as a dependency.

Support for the <math> tag is turned off by default. To enable it, add the flutter_html_math package as a dependency and configure your Html widget:

Html(
  data: ...,
  extensions: [
    // Add this to your extensions
    MathHtmlExtension(),
  ],
)

Coming Soon!

NOTE: <svg> requires that you add the package flutter_html_svg as a dependency.

Support for the <svg> tag is turned off by default. To enable it, add the flutter_html_svg package as a dependency and configure your Html widget:

Html(
  data: ...,
  extensions: [
    // Add this to your extensions
    SvgHtmlExtension(),
  ],
)

NOTE: <table> and related tags require that you add the package flutter_html_table as a dependency.

Support for the <table> tag and related tags are turned off by default. To enable them, add the flutter_html_table package as a dependency and configure your Html widget:

Html(
  data: ...,
  extensions: [
    // Add this to your extensions
    TableHtmlExtension(),
  ],
)

NOTE: <video> requires that you add the package flutter_html_video as a dependency.

Support for the <video> tag is turned off by default. To enable it, add the flutter_html_video package as a dependency and configure your Html widget:

Html(
  data: ...,
  extensions: [
    // Add this to your extensions
    VideoHtmlExtension(),
  ],
)
Clone this wiki locally