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
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>