Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ponnamkarthik/FlutterHtmlView
Flutter Plugin to render html as a Widget
https://github.com/ponnamkarthik/FlutterHtmlView
Last synced: 2 months ago
JSON representation
Flutter Plugin to render html as a Widget
- Host: GitHub
- URL: https://github.com/ponnamkarthik/FlutterHtmlView
- Owner: ponnamkarthik
- License: apache-2.0
- Created: 2018-04-15T04:33:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-19T13:43:11.000Z (almost 5 years ago)
- Last Synced: 2024-08-03T09:06:57.522Z (6 months ago)
- Language: Dart
- Size: 186 KB
- Stars: 241
- Watchers: 8
- Forks: 107
- Open Issues: 44
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-star - FlutterHtmlView
README
# flutter_html_view
Flutter Plugin to render html as a Widget,
> [Refer this for full support of inline webview for android and iOS](https://github.com/PonnamKarthik/FlutterWebView)
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
```yaml
dependencies:
flutter_html_view: ^0.5.11
``````dart
import 'package:flutter_html_view/flutter_html_view.dart';
String html = 'Hello world! 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 `/ios/Runner/Info.plist`:
```xml
NSAppTransportSecurityNSAllowsArbitraryLoads
```
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:
```xml
```
# Thanks to
[@Katran](https://github.com/Katarn)