搜尋套件、儲存庫與 APP 分類

套件詳情v1.0.1

html_editor

Flutter HTML 編輯器是用於 Android 和 iOS 的文字編輯器,可幫助您根據 Summernote JavaScript 包裝器撰寫所見即所得的 HTML 程式碼。

近 30 天下載
57
喜歡數
118
Pub 分數
40

安裝套件

flutter pub add html_editor

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Flutter HTML Editor 是一個適用於 Android 與 iOS 的 WYSIWYG 文字編輯器,讓使用者能在 Flutter 應用中直接建立與編輯 HTML 內容。基於 Summernote JavaScript 庫建構,提供熟悉且豐富的文字編輯體驗,支援格式化、圖片、連結等。此套件可透過簡單的 pub add 命令無縫整合至 Flutter 項目,並為開發者提供乾淨的介面,以便在其應用中加入 HTML 輸入功能。非常適合內容創作工具、CMS 整合,或任何需要富文字輸入並輸出 HTML 的應用。

適用情境

  • 行動應用程式中的內容創建
  • CMS 或部落格編輯器
  • 富文本輸入表單
  • 基於 HTML 的筆記應用
  • 使用者產生內容平台

主要特色

  • 所見即所得 HTML 編輯
  • 對圖片和連結的支援
  • 與 Summernote 的整合
  • 跨平台(iOS 與 Android)
  • 透過 pub 的簡單 Flutter 結合

適合對象

  • 開發富文本編輯器的開發者
  • 需要 HTML 輸入的應用程式
  • 行動內容管理系統
  • 教育或出版類應用
  • 需要富文本的表單建構器

使用建議

  • 無需原生程式碼即可進行有限的自訂
  • 依賴於 WebView 渲染
  • 可能需要額外的樣式以保持一致性
  • 不適用於複雜文件處理
  • 效能可能在舊裝置上有所差異

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Flutter Html Editor

Flutter HTML Editor is a text editor for android and iOS to help write WYSIWYG HTML code based on the Summernote javascript wrapper. with this library you can insert images into the text editor

demo example demo android demo ios

Setup

add html_editor: ^1.0.1 as deppendecy to pubspec.yaml

iOS

Add the following keys to your Info.plist file, located in /ios/Runner/Info.plist:

    <key>io.flutter.embedded_views_preview</key>
    <true/>

    <key>NSCameraUsageDescription</key>
    <string>Used to demonstrate image picker plugin</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Used to capture audio for image picker plugin</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Used to demonstrate image picker plugin</string>

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
         <true/>
    </dict>
Usage
  1. import flutter html editor
    import 'package:html_editor/html_editor.dart';
  1. Create Global key from HTML Editor State
    GlobalKey<HtmlEditorState> keyEditor = GlobalKey();
  1. Add HTML Editor to widget
    HtmlEditor(
        hint: "Your text here...",
        //value: "text content initial, if any",
        key: keyEditor,
        height: 400,
    ),
  1. Get text from Html Editor
    final txt = await keyEditor.currentState.getText();
Avalaible option parameters
Parameter Type Default Description
key GlobalKey required for get method & reset
value String empty iniate text content for text editor
height double 380 height of text editor
decoration BoxDecoration Decoration editor
useBottomSheet bool true if true Pickup image user bottomsheet or dialog if else
widthImage String 100% width of image picker
showBottomToolbar bool true show hide bottom toolbar
hint String empty Placeholder hint text

License

This project is licensed under the MIT License - see the LICENSE file for details.

#MajalengkaExoticSundaland

所屬分類

依賴

依賴清單 4 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。