1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Copying text from HTML Editor in Rich Text

Discussão em 'Mobile' iniciado por Stack, Novembro 9, 2024 às 23:12.

  1. Stack

    Stack Membro Participativo

    I have a Flutter Web app and I have a HTML string which I am rendering using html_editor_enhanced. When I highlight the text and press CTRL+C on my keyboard, I can paste it into my Gmail and it appears with all the formatting in place, like Rich Text. However, when I use the HtmlEditorController to get the text (_htmlEditorController.getText()) and then store it in the Clipboard (await Clipboard.setData(ClipboardData(text: rawHtml))), it returns all the raw HTML, including tags. When I paste it into Gmail, it's just the raw HTML with no formatting.

    How can I imitate what the standard copy (CTRL+C) does in code, so I can paste it into Gmail and maintain the formatting?

    Continue reading...

Compartilhe esta Página