パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.5.12

flutter_html_view

HTMLをレンダリングするためのFlutterプラグイン、FlutterにはデフォルトでHTMLのレンダリングをサポートしていないため、このパッケージはHTMLをネイティブウィジェットにレンダリングするのに役立ちます

30日間ダウンロード
131
いいね数
26
Pub ポイント
40

パッケージをインストール

flutter pub add flutter_html_view

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutterアプリ内にHTMLコンテンツをネイティブウィジェットとしてレンダリングできるFlutterプラグインです。Flutterは本来HTMLレンダリングをサポートしていないため、このパッケージはHTML文字列を解析し、対応するFlutterウィジェットに変換することでギャップを埋めています。基本的なHTMLタグとCSSスタイルのサポートにより、フォーマットされたテキストやブログ記事、Webソースからの動的コンテンツの表示に最適です。パッケージは軽量で、既存のFlutterプロジェクトとの統合がスムーズです。

用途

  • フォーマットされたブログコンテンツを表示しています
  • API から動的 HTML をレンダリングする
  • アプリでリッチテキストを表示する
  • ユーザーが生成したHTMLを埋め込む
  • シンプルなウェブ風のインターフェースを作成する

主な機能

  • HTML から Widget への変換
  • 基本的な CSS サポート
  • 軽量で高速
  • Flutter との簡単な統合
  • 一般的なHTMLタグをサポートしています

適している対象

  • 豊富なテキスト表示を必要とするアプリ
  • コンテンツ重視のアプリケーション
  • シンプルなウェブコンテンツレンダリング
  • HTML データを扱う開発者
  • 最小限の依存関係を必要とするプロジェクト

注意事項

  • 制限された高度なCSSサポート
  • JavaScript の実行なし
  • 複雑なウェブページには適していません
  • 信頼できないHTMLのセキュリティリスク
  • 大規模なHTMLコンテンツではパフォーマンスが低下する可能性があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

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

カテゴリー

依存関係

依存関係一覧 6 件

ソースリポジトリ

このパッケージを使用しているプロジェクト