singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.56k stars 823 forks source link

flutter_quill_extensions is not working in android #2021

Closed rashmi-key closed 3 weeks ago

rashmi-key commented 3 months ago

Is there an existing issue for this?

The question

Following pub version I'm using . We are not getting any error but not able to write anything . Below is the code snippet

QuillRichTextEditor(
  width: double.infinity,
  padding: EdgeInsets.symmetric(
     horizontal: Sizes.L.getValue(),
     vertical: Sizes.S.getValue()),
  height: 180.0,
  borderColor: KeyTheme.of(context).borderColor,
  fontColor: KeyTheme.of(context).tertiaryText,
  borderWidth: 2.0,
  fontSize: 15.0,
  borderRadius: 12.0,
  hintText: StringConst.eventDescriptionHint,
  hintTextColor: KeyTheme.of(context).textHintColor,
  initialText: eventDescription,
  controller: quillControllerEventDesc,
  onValueChanged: (quillResult) async {},
)
  flutter_quill: 9.3.12
  dart_quill_delta: 9.3.21
  flutter_quill_extensions: 9.3.4
  flutter_quill_test: 9.3.4
  vsc_quill_delta_to_html: ^1.0.5
CatHood0 commented 3 months ago

I'll suppose QuillRichTextEditor is your own custom widget that is wrapping your QuillEditor implementation. So, do you already pass embedBuilders list from FlutterQuillEmbeds to your QuillEditorConfigurations?

Here is a code example of the embedBuilder param:

QuillEditorConfigurations(
  embedBuilders: [
     ...(isWeb()
     ? FlutterQuillEmbeds.editorWebBuilders()
     : FlutterQuillEmbeds.editorBuilders(),
  ] 
);

If you already has these configs, then, update to the last version of flutter_quill and flutter_quill_extension and watch if the error still persisting.

Please, take a look about the documentation at Embed blocks

EchoEllet commented 3 months ago

Not related to the issue, though we recommend using the same version for all packages from this repository for better compatibility, we might import some non public API from flutter_quill in flutter_quill_extensions or do some internal breaking changes that cause build failure, even if you don't have any built failure, some fixes require changes from both packages.

Regarding the fix, try the suggestion above, and let's know if the issue persists.

rashmi-key commented 3 months ago

flutter_quill_extension

Added this param still issue persist in android . After updating to the latest version getting below error.

` ======== Exception caught by widgets library ======================================================= The following assertion was thrown building QuillEditorBuilderWidget: A GlobalKey was used multiple times inside one widget's child list.

The offending GlobalKey was: [LabeledGlobalKey#28eb4] The parent of the widgets with that key was: QuillEditorBuilderWidget The first child to get instantiated with that key became: QuillRawEditor-[LabeledGlobalKey#28eb4] dirty dependencies: [DefaultTextStyle, _InheritedTheme, _LocalizationsScope-[GlobalKey#f7ec3]] state: QuillRawEditorState#8cdd5(lifecycle state: initialized, tickers: tracking 2 tickers) The second child that was to be instantiated with that key was: QuillEditorBuilderWidget A GlobalKey can only be specified on one widget at a time in the widget tree. The relevant error-causing widget was:

`

In my scenario have to use 3 quill editor in the single screen . So I have added key UniqueKey() all the 3 quilleditor. Below is the code snippet . QuillRichTextEditorV2( key: UniqueKey(), readOnly: false, quillControllerEdit: quillControllerEditAdd, scrollController: editorScrollControllerEdiAdd, buildContext: context, editorFocusNode: editorFocusNodeEditAdd, onImagePickCallback: _onImagePickCallback),

rashmi-key commented 2 months ago

Any update on the above mentioned issues?