Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use delta json format that i saved in widget #2408

Open
1 task done
Binisha1 opened this issue Dec 5, 2024 · 2 comments
Open
1 task done

use delta json format that i saved in widget #2408

Binisha1 opened this issue Dec 5, 2024 · 2 comments
Labels
question Further information is requested

Comments

@Binisha1
Copy link

Binisha1 commented Dec 5, 2024

Is there an existing issue for this?

The question

how can i use quill deltajson data that i stored in backend in text widget

i am doing it like this

final _controller = QuillController( 
    readOnly: true,
    document: Document.fromJson(jsonDecode(
        r'[{"insert":"normaltext"},{"insert":"italic","attributes":{"bold":true}},{"insert":"\n"}]')),
    selection:const  TextSelection(baseOffset: 0, extentOffset: 0),
  );

in widget

QuillEditor(
                    configurations:
                        const QuillEditorConfigurations(showCursor: false),
                    controller: _controller,
                    focusNode: FocusNode(),
                    scrollController: ScrollController()),

can't i do it without using quillEditor

@Binisha1 Binisha1 added the question Further information is requested label Dec 5, 2024
@ZhuJHua
Copy link

ZhuJHua commented Dec 6, 2024

As mentioned, the data is in Delta JSON format rather than plain text, so a QuillController is required to render and display it.

@ZhuJHua
Copy link

ZhuJHua commented Dec 6, 2024

By the way, if you prefer not to use a QuillController, you can consider trying the following plugins.

The following packages can be used:

vsc_quill_delta_to_html: To convert Delta to HTML.
flutter_quill_delta_from_html: To convert HTML to Delta.
flutter_quill_to_pdf: To convert Delta To PDF.
markdown_quill: To convert Markdown To Delta and vice versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants