flutter_widget_from_html 0.1.0

  • README.md
  • Example
  • Installing
  • Versions
  • 87

Flutter Widget from HTML

A Flutter plugin for building Flutter-widget tree from html.

This package extends the flutter_widget_from_html_core package with extra functionalities by using external depedencies like cached_network_image or url_launcher. It should be good enough as a quick starting point but you can always use the core directly if you dislike the dependencies.


To use this plugin, add flutter_widget_from_html as a dependency in your pubspec.yaml file.

See the Example app for inspiration.


Note: HtmlWidget.config is optional, see dartdoc for all available configuration keys and their default values.

class HelloWorldScreen extends StatelessWidget {
  Widget build(BuildContext context) => Scaffold(
      appBar: AppBar(
        title: Text('HelloWorldScreen'),
      body: ListView(
        children: <Widget>[
          HtmlWidget("""<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<p>A paragraph with <strong>strong</strong> <em>emphasized</em> text.</p>
<p>And of course, cat image: <img src="https://media.giphy.com/media/6VoDJzfRjJNbG/giphy-downsized.gif" /></p>
<div style="text-align: center">Source: <a href="https://gph.is/QFgPA0">https://gph.is/QFgPA0</a></div>


This package has all the features of flutter_widget_from_html_core and some nice extras:

  • Renders A tag with theme accent color, launch url via url_launcher
  • Renders IMG tag with CachedNetworkImage and padding (Config.imagePadding)
  • Renders lists (OL/UL) with marker and padding (Config.listBullet, Config.listPaddingLeft)
  • Renders texts with padding (Config.textPadding)
  • Supports relative url (A href, IMG src)


  • First release


import 'package:flutter/material.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Widget from HTML',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Widget from HTML'),
        body: Center(
          child: HtmlWidget('Hello World!'),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_widget_from_html: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
Version Uploaded Documentation Archive
0.1.0 Oct 19, 2018 Go to the documentation of flutter_widget_from_html 0.1.0 Download flutter_widget_from_html 0.1.0 archive
0.0.2 Oct 19, 2018 Go to the documentation of flutter_widget_from_html 0.0.2 Download flutter_widget_from_html 0.0.2 archive
0.0.1 Oct 18, 2018 Go to the documentation of flutter_widget_from_html 0.0.1 Download flutter_widget_from_html 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.10
  • Flutter: 1.1.7


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

23 out of 23 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
cached_network_image ^0.4.2 0.4.2 0.5.1
flutter 0.0.0
flutter_widget_from_html_core ^0.1.0 0.1.0
url_launcher ^4.0.0 4.0.3
Transitive dependencies
args 1.5.1
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.1.1
crypto 2.0.6
csslib 0.14.6
flutter_cache_manager 0.1.2 0.2.0+1
http 0.11.3+17 0.12.0+1
http_parser 3.1.3
logging 0.11.3+2
meta 1.1.6 1.1.7
path 1.6.2
path_provider 0.4.1
shared_preferences 0.4.3
sky_engine 0.0.99
source_span 1.5.1
string_scanner 1.0.4
synchronized 1.5.3+2
term_glyph 1.1.0
typed_data 1.1.6
utf 0.9.0+5
uuid 1.0.3 2.0.0-rc1
vector_math 2.0.8
Dev dependencies
html ^0.13.3 0.13.3+3