flutter_html_view
HTML을 렌더링하기 위한 Flutter 플러그인, Flutter는 기본적으로 HTML 렌더링을 지원하지 않기 때문에 이 패키지는 HTML을 네이티브 위젯으로 렌더링하는 데 도움을 줍니다
HTML을 위젯으로 렌더링하는 Flutter 플러그인
{"sdk":"flutter"}^0.6.0^0.13.3+30.10.0+2^0.7.0^0.2.0^0.3.0아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
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
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)
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
)
styleSheet: MarkdownStyleSheet(
),
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" |
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.
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"/>