
The DOM document passed to the Html widget. This is required and cannot be null when using Html(). Currently the SelectableText.rich() constructor does not support WidgetSpans, resulting in the feature losses above. Once the above issue is resolved, the aforementioned compromises will go away. bold or italic), while container related styling (e.g. Styling support is significantly reduced. (Support for customRender may be added in the future). No support for customRender, customImageRender, onImageError, onImageTap, onMathError, and navigationDelegateForIframe. Key omissions include no support for images/video/audio, table, and ul/ol. The list of tags that can be rendered is significantly reduced. Please note: Due to Flutter #38474, selectable text support is significantly watered down compared to the standard non-selectable version of the widget. The difference between the two is the same as noted above.

The package also has two constructors for selectable text support - SelectableHtml() and omDom(). This eliminates the need to parse the modified Document back to a string, pass to Html(), and convert back to a Document, thus cutting down on load times. Then, you can directly pass the modified Document to the package. If you would like to modify or sanitize the HTML before rendering it, then omDom() is for you - you can convert the HTML string to a Document and use its methods to modify the HTML as you wish. The Html() constructor is for those who would like to directly pass HTML from the source to the package to be rendered. The package currently has two different constructors - Html() and omDom().
#List of html tags code#
If you need something more robust and customizable, the package also provides a number of optional custom APIs for extremely granular control over widget rendering! API Reference: #īelow, you will find brief descriptions of the parameters the Html widget accepts and some code snippets to help you use this package. This project has expanded to include support for basic styling as well! Originally created to allow basic rendering of HTML content into the Flutter widget tree, This package is designed with simplicity in mind. Typedef ImageSourceMatcher (with examples)Īdd the following to your pubspec.yaml file: dependencies:Ĭurrently Supported Inline CSS Attributes: #ĭon't see a tag or attribute you need? File a feature request or contribute to the project! Why this package? # Screenshot 1Ĭurrently Supported Inline CSS Attributes A Flutter widget for rendering HTML and CSS as Flutter widgets.
