flutter-quill icon indicating copy to clipboard operation
flutter-quill copied to clipboard

Handle multiple QuillEditors

Open naifalharbi202 opened this issue 2 years ago • 10 comments

Is there an existing issue for this?

The question

I have two separated QuillEditors in my Flutter app. But whatever I type in the first one automatically appears in the second one. I know it's a matter of controllers but I really couldn't find a way to control them separately. I am using the latest version of the package.

naifalharbi202 avatar Dec 04 '23 14:12 naifalharbi202

Hello there, on behalf the Flutter Quill Team I would like to thank you for opening your first issue. Your inputs and insights are valuable in shaping a stable and reliable version for all our users. Thank you for being part of the open-source community!

singerdmx avatar Dec 04 '23 14:12 singerdmx

You can wrap QuillProvider for each QuillEditor, that is what I did for my app. If you want all editors to use a same toolbar, then wrap that toolbar with another QuillProvider, and use ChangeNotifier + focusNode to switch the controller

By the way, quill has a lot of issues (they are changing a lot of code, that is understandable) regarding performance and unnecessary editor rebuild, and I also don't like the idea of QuillProvider, its hard to use for many usecases. After spent many days with Quill, I decided to switch to this one https://github.com/fleather-editor/fleather/tree/master/packages/fleather/lib/src

binhtran93 avatar Dec 04 '23 15:12 binhtran93

You can wrap QuillProvider for each QuillEditor, that is what I did for my app. If you want all editors to use a same toolbar, then wrap that toolbar with another QuillProvider, and use ChangeNotifier + focusNode to switch the controller

By the way, quill has a lot of issues (they are changing a lot of code, that is understandable) regarding performance and unnecessary editor rebuild, and I also don't like the idea of QuillProvider, its hard to use for many usecases. After spent many days with Quill, I decided to switch to this one https://github.com/fleather-editor/fleather/tree/master/packages/fleather/lib/src

Thank you very much @binhtran93. Yes, I agree the idea of QuillProvider on every QuillEditor isn't a good way to handle multiple QuillEditors. It should be like TextFormFields where every one has its own controller but same toolbar.

naifalharbi202 avatar Dec 05 '23 03:12 naifalharbi202

You can wrap QuillProvider for each QuillEditor, that is what I did for my app. If you want all editors to use a same toolbar, then wrap that toolbar with another QuillProvider, and use ChangeNotifier + focusNode to switch the controller

By the way, quill has a lot of issues (they are changing a lot of code, that is understandable) regarding performance and unnecessary editor rebuild, and I also don't like the idea of QuillProvider, its hard to use for many usecases. After spent many days with Quill, I decided to switch to this one https://github.com/fleather-editor/fleather/tree/master/packages/fleather/lib/src

Thank you for the report, we will consider this regarding the performance and unnecessary editor rebuild it was an old issue from the older versions and we are working on it

EchoEllet avatar Dec 05 '23 03:12 EchoEllet

Thank you for the feedbacks, we are already working on a new major version

EchoEllet avatar Dec 05 '23 04:12 EchoEllet

The issue has been fixed in the dev branch but it will take a few months before the release

We are working on improving the raw quill editor

EchoEllet avatar Dec 05 '23 04:12 EchoEllet

You can wrap QuillProvider for each QuillEditor, that is what I did for my app. If you want all editors to use a same toolbar, then wrap that toolbar with another QuillProvider, and use ChangeNotifier + focusNode to switch the controller By the way, quill has a lot of issues (they are changing a lot of code, that is understandable) regarding performance and unnecessary editor rebuild, and I also don't like the idea of QuillProvider, its hard to use for many usecases. After spent many days with Quill, I decided to switch to this one https://github.com/fleather-editor/fleather/tree/master/packages/fleather/lib/src

Thank you very much @binhtran93. Yes, I agree the idea of QuillProvider on every QuillEditor isn't a good way to handle multiple QuillEditors. It should be like TextFormFields where everyone has its own controller but the same toolbar.

Thank you for the feedback again, we already dropped the support and use for QuillProvider Regarding the performance issues we are working on them, we made a lot of breaking changes but that's only in versions 7.0.0 to 8.0.0

Besides Google itself with it products and libraries made a lot of breaking changes all the time so even if we don't want to , we still have to adapt the latest updates

Now we will only work in the dev branch for a while and provide hotfixes for the master

The code changes should not affect the developer much unless it was fixes or breaking changes

EchoEllet avatar Dec 06 '23 07:12 EchoEllet

I have two separated QuillEditors in my Flutter app. But whatever I type in the first one automatically appears in the second one. I know it's a matter of controllers but I really couldn't find a way to control them separately. I am using the latest version of the package.

Can you give the latest dev version a try? Tell me if it fixed the issue and handle it more efficiently

EchoEllet avatar Dec 06 '23 18:12 EchoEllet

dev

Thank you very much. I will give it a look later today and you will have my feedback soon.

naifalharbi202 avatar Dec 08 '23 11:12 naifalharbi202

I have two separated QuillEditors in my Flutter app. But whatever I type in the first one automatically appears in the second one. I know it's a matter of controllers but I really couldn't find a way to control them separately. I am using the latest version of the package.

Can you give the latest dev version a try? Tell me if it fixed the issue and handle it more efficiently

I was really busy lately, so I am sorry for being late.. But I just updated to the latest version .. I can see that you dropped the support for QuillProvider. However, the problem of handling multiple Quill Editors seperately is still there.. One single controller for QuillToolbar and one QuillEditor. If you want to have multiple QuillEditors on the same screen with one QuillToolbar that controls all of them seperately, you can't.

As for your last reply here, I can see the dev verison now has been updated 60 days ago.

naifalharbi202 avatar Feb 05 '24 07:02 naifalharbi202