搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目

暂无相关数据。