pub package

A Flutter widget for rendering matrix-flavoured html tags as flutter widgets.


Add the following to your pubspec.yaml file:

  flutter_matrix_html: ^1.0.0

Currently Supported HTML Tags:

b, strong, i, em, br, tt, code, ins, u, sub, sup, del, s, strike, span, font, a, img, table, thead, tbody, tfoot, th, td, caption, ul, ol, li, div, p, h1, h2, h3, h4, h5, h6, pre, blockquote, hr, details, summary


  • mx-reply is stripped
  • Spoilers (including reason)
  • Inline and Block LaTeX
  • Pills for a tags starting with https://matrix.to/#/ and the matrix: URI
  • Various ways of setting the text colour and background colour are supported

Example Usage:

  data: """
    <!--For a much more extensive example, look at example/main.dart-->
      <h1>Demo Page</h1>
      <p>This is a fantastic nonexistent product that you should buy!</p>
      <p>Lorem ipsum <b>dolor</b> sit amet.</p>
      <h2>The Team</h2>
      <p>There isn't <i>really</i> a team...</p>
      <p>You <u>cannot</u> install a nonexistent product!</p>
      <!--You can pretty much put any html in here!-->
  //Optional parameters:
  padding: EdgeInsets.all(8.0),
  backgroundColor: Colors.white70,
  defaultTextStyle: TextStyle(fontFamily: 'serif'),
  linkStyle: const TextStyle(
    color: Colors.redAccent,
  onLinkTap: (url) {
    // open url in a webview
  onImageTap: (src) {
    // Display the image in large form.