infitio / flutter_markdown

Minimalistic, highly customizable - regexp based Markdown widget for Flutter
Other
14 stars 6 forks source link

Option to specify font family for code #2

Closed geoah closed 4 years ago

geoah commented 4 years ago

Code blocks don't seem to be correctly rendered on MacOS and IOS. I assume the reason is the same as this https://github.com/flutter/flutter/issues/19280 as from what I can tell flutter_markdown also tries to set the font family to monospace.

Would it be possible to have a way to specify the style for code blocks?

tiholic commented 4 years ago

@geoah Can you raise a PR with necessary changes

geoah commented 4 years ago

@tiholic seems like there is an easy workaround, sorry I didn't really think about this before.

Thank you for this amazing library.

        tokenConfigs: [
          MarkdownTokenConfig.code(
            textStyle: textTheme.bodyText1.copyWith(
              fontFamilyFallback: ["Courier"],
            ),
          ),
        ],