flutter_widget_from_html_core
0.17.4, released 2 months ago by daohoangson.com
Render HTML content as native Flutter widgets with correctness and extensibility.
What it does
Parses HTML strings and CSS into structured Flutter widgets, supporting over 70 popular tags, custom styling, inline attributes, and extensibility hooks for links, images, and custom builders.
AI-written summary of version 0.17.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display rich HTML content or blog posts inside a Flutter app.
- You want support for common HTML formatting, tables, lists, and CSS inline styles without building a full WebView.
Skip it when
- You need full browser capabilities like JavaScript execution or complex web application hosting (use a WebView instead).
- You need native support for audio, video, or SVG out-of-the-box in the core package without adding separate extension packages.
Strengths
- High correctness and extensive support for CSS styles and HTML tags.
- Extensible widget factory and custom styling builders.
- Supports multiple render modes like Column, ListView, or SliverList for performance.
Weaknesses
- Does not support full JavaScript execution or interactive web apps.
- Some rich elements like audio, video, and SVG require separate extension packages.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
Add the dependency to pubspec.yaml and import the package to use the HtmlWidget.
HtmlWidget(
'''
<h3>Heading</h3>
<p>A paragraph with <strong>strong</strong> text.</p>
''',
textStyle: TextStyle(fontSize: 14),
)Alternatives
Packages that do the same job and could replace flutter_widget_from_html_core.
- flutter_tex
Renders mathematical and chemical equations using LaTeX, TeX, MathML, and AsciiMath.
83Compare - flutter_html
Renders static HTML and CSS as Flutter widget trees.
56Compare - seo_renderer
Renders Flutter text, link, and image widgets as HTML elements for SEO purposes on the web.
50Compare - flutter_html_table
Renders HTML table tags within the flutter_html package using flutter_layout_grid.
60Compare
Works with
Packages commonly used together with flutter_widget_from_html_core: ones it builds on, ones built on it, and its own family.
- htmlflutter_widget_from_html_core depends on itA Dart implementation of an HTML5 parser for strings and bytes.
- loggingflutter_widget_from_html_core depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- csslibflutter_widget_from_html_core depends on itA Dart library that parses CSS strings or byte lists into an AST.
- fwfh_webviewBuilt on flutter_widget_from_html_coreWidgetFactory extension to render IFRAME elements using the official WebView plugin.
- fwfh_svgBuilt on flutter_widget_from_html_coreWidgetFactory extension to render SVG inside HTML widgets via flutter_svg.
- fwfh_url_launcherBuilt on flutter_widget_from_html_coreWidgetFactory mixin to launch links in HTML widgets via url_launcher.
- flutter_widget_from_htmlBuilt on flutter_widget_from_html_coreRender HTML content as native Flutter widgets with support for common tags, CSS, and media.
- fwfh_cached_network_imageBuilt on flutter_widget_from_html_coreWidgetFactory extension to render HTML IMG tags using cached_network_image.