Html wysiwyg editor in flutter?

Viewed 3874

is there any way to use summernote or wysiwyg editor in Flutter textfield editor?

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:

    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?

enter image description here

thanks

2 Answers

you can try my package html_editor_enhanced which does not have the getText() error and uses fully native controls with plenty of customization. It looks like this:

enter image description here

Using flutter_summernote

getText() always throw error, but I have a work around

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 = _;
  }),

Related