flutter_matrix_html 1.2.0 copy "flutter_matrix_html: ^1.2.0" to clipboard
flutter_matrix_html: ^1.2.0 copied to clipboard

A Flutter widget for rendering static matrix html tags as Flutter widgets. (Will render over 70 different html tags!)

flutter_matrix_html #

pub package

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

Installing: #

Add the following to your pubspec.yaml file:

dependencies:
  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

Additionally:

  • 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: #

Html(
  data: """
    <!--For a much more extensive example, look at example/main.dart-->
    <div>
      <h1>Demo Page</h1>
      <p>This is a fantastic nonexistent product that you should buy!</p>
      <h2>Pricing</h2>
      <p>Lorem ipsum <b>dolor</b> sit amet.</p>
      <h2>The Team</h2>
      <p>There isn't <i>really</i> a team...</p>
      <h2>Installation</h2>
      <p>You <u>cannot</u> install a nonexistent product!</p>
      <!--You can pretty much put any html in here!-->
    </div>
  """,
  //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.
  },
)
3
likes
110
pub points
76%
popularity

Publisher

unverified uploader

A Flutter widget for rendering static matrix html tags as Flutter widgets. (Will render over 70 different html tags!)

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (LICENSE)

Dependencies

cached_network_image, crypto, csslib, flutter, flutter_highlight, flutter_math_fork, highlight, html, isolate, matrix_link_text

More

Packages that depend on flutter_matrix_html