asjqkkkk / markdown_widget

📖Rendering markdown by flutter!Welcome for pr and issue.
MIT License
312 stars 90 forks source link

P blocks don't have dark mode by default #154

Closed stefanosiano closed 6 months ago

stefanosiano commented 7 months ago

Describe the bug P blocks don't have dark mode by default. It seems the error lies in this line, as it's the only config where darkConfig doesn't overwrite the color.

To Reproduce Steps to reproduce the behavior: Just put any text enabling the dark config, and the text will still be black.

Expected behavior The text should be white.

Nice work with this library!

asjqkkkk commented 7 months ago

Hi @stefanosiano thanks for your issue, the current color of the text is controlled by the Theme, so there is no inclusion of color in PConfig. In the future, there may be consideration to remove darkConfig from PConfig or include color in darkConfig.

stefanosiano commented 7 months ago

oh, I see. I have to make some other test, as it was showing a dark text when using a dark theme (it was inside a Theme widget) with default values. I'll let you know if there is any news

stefanosiano commented 6 months ago

I can confirm it was an issue on how i created the Theme. I had to specify the text color, too, using

              Theme(
                data: theme,
                child: DefaultTextStyle.merge(
                  style: TextStyle(color: theme.textTheme.bodyMedium!.color),
                  child: MarkdownBlock (...),
                ),
              )