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

How to Display final output #2

Closed
egnimos opened this issue Mar 10, 2021 · 6 comments
Closed

How to Display final output #2

egnimos opened this issue Mar 10, 2021 · 6 comments
Labels
question Further information is requested

Comments

@egnimos
Copy link

egnimos commented Mar 10, 2021

I want to display the final output on the flutter web, but there is no option to display the final output... Can you help me on this
please

@tneotia
Copy link
Owner

tneotia commented Mar 10, 2021

Check the example app, it works on Flutter Web. TLDR:

initialize editor:

HtmlEditorController controller = HtmlEditorController();

HtmlEditor(
   controller: controller
)

get text:

String? txt = await controller.getText();
setState(() {
   textToDisplay = txt;
});

widget:

Text(textToDisplay)

Let me know if you have any issues with this.

@tneotia tneotia added the question Further information is requested label Mar 11, 2021
@tneotia
Copy link
Owner

tneotia commented Mar 15, 2021

I had another thought about this - if you want to display the output in WYSIWYG format with Flutter widgets, I recommend you use flutter_html like this:

initialize editor:

HtmlEditorController controller = HtmlEditorController();

HtmlEditor(
   controller: controller
)

get text:

String? txt = await controller.getText();
setState(() {
   htmlString = txt;
});

widget:

Html(data: htmlString ?? "No data!")

I don't want to add this as an option in the package because it is quite a heavy dependency, but the option is there if you want to use it.

@tneotia tneotia closed this as completed Mar 15, 2021
@Sammy-iiitb
Copy link

String? txt = await controller.getText();
setState(() {
htmlString = txt;
});

submit button it's not able to set the state in the latest version on web, can you check

@tneotia
Copy link
Owner

tneotia commented May 5, 2021

Do you get any errors in the console?

@Sammy-iiitb
Copy link

there are no errors on the console, the state is not set, when I am trying to print the txt, the console is just stuck there, no response in the console.

@tneotia
Copy link
Owner

tneotia commented May 6, 2021

Yep I found the issue and it is fixed on master. the stream.drain() line in the getText() code was causing the issue, it did the same thing for mobile height detection. Thanks for the report!

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

3 participants