简体   繁体   English

Html flutter 中的所见即所得编辑器?

[英]Html wysiwyg editor in flutter?

is there any way to use summernote or wysiwyg editor in Flutter textfield editor?有没有办法在 Flutter 文本字段编辑器中使用 Summernote 或所见即所得编辑器?

I used flutter_html_editor, Zefyr, html_editor and flutter_summernote packages, but these dont worked well and they returned null value in the following code:我使用了 flutter_html_editor、Zefyr、html_editor 和 flutter_summernote 包,但这些包效果不佳,它们在以下代码中返回 null 值:

    final _etEditor = await keyEditor.currentState.getText();

I got the following error:我收到以下错误:

E/flutter ( 6639): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: NoSuchMethodError: The method 'getText' was called on null.
E/flutter ( 6639): Receiver: null
E/flutter ( 6639): Tried calling: getText()

I want that the textfield become like the attached image.我希望文本字段变得像附加的图像。 How to fix it?如何解决?

Can I implement a package like these, or is there any solution to make summernote or wysiwyg textfield editor which can convert html tags in Flutter?我可以实现像这样的 package,还是有任何解决方案来制作可以转换 Flutter 中的 html 标签的summernote或所见即所得的文本字段编辑器?

在此处输入图像描述

thanks谢谢

you can try my package html_editor_enhanced which does not have the getText() error and uses fully native controls with plenty of customization.您可以尝试我的 package html_editor_enhanced ,它没有getText()错误,并使用具有大量自定义功能的完全本机控件。 It looks like this:它看起来像这样:

在此处输入图像描述

Using flutter_summernote使用flutter_summernote

getText() always throw error, but I have a work around getText() 总是抛出错误,但我有一个解决方法

 GlobalKey < FlutterSummernoteState > _keyEditor = GlobalKey(); String globalText = ""; FlutterSummernote( //showBottomToolbar: _keyboardVisible, hasAttachment: true, value: globalText, hint: globalText == null? "Your text here...": "", key: _keyEditor, returnContent: (_) { print("text from return Context $_"); globalText = _; }),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM