Search packages, repositories and app categories

Package detailsv0.5.12

flutter_html_view

Flutter Plugin to render html, Flutter has no default support to render html so this package helps you to render your html to native widgets

30-day downloads
131
Likes
26
Pub points
40

Install package

flutter pub add flutter_html_view

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter plugin that enables rendering HTML content as native widgets within a Flutter app. Since Flutter does not natively support HTML rendering, this package bridges the gap by parsing HTML strings and converting them into corresponding Flutter widgets. It supports basic HTML tags and CSS styling, making it ideal for displaying formatted text, blog posts, or dynamic content from web sources. The package is lightweight and integrates seamlessly with existing Flutter projects.

Use cases

  • Displaying formatted blog content
  • Rendering dynamic HTML from APIs
  • Showing rich text in apps
  • Embedding user-generated HTML
  • Creating simple web-like interfaces

Key features

  • HTML to widget conversion
  • Basic CSS support
  • Lightweight and fast
  • Easy integration with Flutter
  • Supports common HTML tags

Suitable for

  • Apps needing rich text display
  • Content-heavy applications
  • Simple web content rendering
  • Developers working with HTML data
  • Projects requiring minimal dependencies

Considerations

  • Limited advanced CSS support
  • No JavaScript execution
  • Not suitable for complex web pages
  • Security risks with untrusted HTML
  • Performance may degrade with large HTML content

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter_html_view

Flutter Plugin to render html as a Widget,

Refer this for full support of inline webview for android and iOS

Flutter has no default support to render html so this package helps you to render your html to native widgets

  • Video tag support added
  • Links are clickable now

Supported Tags

  • p
  • em
  • b
  • img
  • video
  • h1, h2, h3, h4, h5, h6

Note

  • This plugin converts some of the html tags to flutter widgets
  • This plugin does't support rendering full html code (there is no built in support for web rendering in flutter)

How to Use

dependencies:
  flutter_html_view: ^0.5.11

import 'package:flutter_html_view/flutter_html_view.dart';

String html = '<body>Hello world! <a href="www.html5rocks.com">HTML5 rocks!';

new HtmlView(
  data: html,
  baseURL: "", // optional, type String
  onLaunchFail: (url) { // optional, type Function
    print("launch $url failed");
  },
  scrollable: false, //false to use MarksownBody and true to use Marksown
)

MarkdownStyleSheet

styleSheet: MarkdownStyleSheet(

),
styleOptions

The default and available style options:

Name Default Options
headingStyle "setext" "setext", "atx"
hr "* * *" "* * *", "- - -", "_ _ _"
bulletListMarker "*" "*", "-", "_"
codeBlockStyle "indented" "indented", "fenced"
fence "```" "```", "~~~"
emDelimiter "_" "_", "*"
strongDelimiter "**" "**", "__"
linkStyle "inlined" "inlined", "referenced"
linkReferenceStyle "full" "full", "collapsed", "shortcut"
iOS

Warning: The video player is not functional on iOS simulators. An iOS device must be used during development/testing.

Add the following entry to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

This entry allows your app to access video files by URL.

Android

Ensure the following permission is present in your Android Manifest file, located in `/android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET"/>

Thanks to

@Katran

Categories

Dependencies

Dependency list 6 items

Source repository

Projects using this package