HTML In Widgets

Fred Grott
5 min readFeb 27, 2022

To build a dev folio site using Flutter, you mix Flutter widgets with HTML. There is a set of plugins that allows you to do this, let me show you how.

The Flutter HTML Package

Typically, you use the Flutter HTML package with some other packages:

dependencies:

flutter_html: ^3.0.0-alpha.2

flutter_html_all: ^3.0.0-alpha.2

flutter_math_fork: ^0.6.1

url_launcher: ^6.0.20

Math Fork is for TexMath and URL Launcher is so that we can launch an opened URL in webview. The mainthing is now we get constructors of Html() and Html.fromDom() with these parameters:

data

document

onLinkTap

customRender

onImageError

onMathError

shrinkWrap

onImageTap

TagList

style

navigatorDelegaeForIFrame

customImageRender

selectionControls

And we can do stuff like:

--

--

Fred Grott
Fred Grott

No responses yet