Skip to content

Font Color doesn't show correctly, all text will be black, and can't apply a font color for text. #1922

Closed
@RodrigoDEVS

Description

@RodrigoDEVS

Is there an existing issue for this?

Flutter Quill version

9.4.1

Steps to reproduce

1, I'm getting html text from an API:

\n <span style="font-size: small;">\n SDS Attached?         Pics Attached?\n
\n
\n Air?                        Ocean?\n
\n
\n Qty:\n
\n
\n Battery Installed?\n
\n
\n
\n <span style="color:#B22222; font-size: 12px;">* FAVOR NO RESPONDER A ESTE CORREO\n
\n \n

\n

2.I'm parsing this text width Document.fromHtml(htmlText), the text shows rightly but not the red color for last line.
3. I'm sending the text to the API to send and email parsing with quillController.document.toDelta().toHtml() using quill_html_converter.dart, the html text is right but it doesn't has the color tag.

Expected results

want to see and send the last line in red color

Actual results

currently the color shown is black

Code sample

Code sample
var html = widget.emailBody?.mailBody ??
        "<p>\n  <span style=\"font-size: small;\">\n    SDS Attached? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Pics Attached?\n    <br/>\n    <br/>\n    Air? &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ocean?\n    <br/>\n    <br/>\n    Qty:\n    <br/>\n    <br/>\n    Battery Installed?\n    <br/>\n    <br/>\n    <br/>\n    <span style=\"color:#B22222; font-size: 12px;\">* FAVOR NO RESPONDER A ESTE CORREO</span>\n    <br/>\n  </span>\n</p>\n";
    quillController2.document = Document.fromHtml(html);

// Quill Editor
Column(
                children: [
                  QuillToolbar.simple(
                      configurations: QuillSimpleToolbarConfigurations(
                          controller: quillController2)),
                  SingleChildScrollView(
                    child: Container(
                        height: 380,
                        width: 550,
                        decoration: const BoxDecoration(color: Colors.white),
                        child: QuillEditor.basic(
                            configurations: QuillEditorConfigurations(
                                controller: quillController2))),
                  ),
                ],
              )

// Send mail button
CustomSaveButton(
                text: 'Send Email',
                active: true,
                onPressed: () async {
                  String htmlContent =
                      quillController2.document.toDelta().toHtml();
                  context.pop();
                  ref
                      .read(whTabControllerProvider.notifier)
                      .sendComplianceEMail(
                          emailParams: ComplianceMailModel(
                              from: '[email protected]',
                              to: controllers[0].text,
                              cc: controllers[1].text,
                              bcc: controllers[2].text,
                              subject: controllers[3].text,
                              msg: htmlContent,
                              attachmentPaths: ref
                                  .watch(whTabControllerProvider)
                                  .attachmentList));
                },
              )

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions