Skip to content
pubscout

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.

WASM-ready
$ flutter pub add flutter_widget_from_html_core
Source repository

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.

Works with

Packages commonly used together with flutter_widget_from_html_core: ones it builds on, ones built on it, and its own family.