Is there any way to change the font size of text when using flutter_markdown? Something like supplying a TextStyle to a Text widget. Thanks!
Markdown(
data: html2md.convert(article.content),
styleSheet: MarkdownStyleSheet.fromTheme(Theme.of(context))
.copyWith(
p: Theme.of(context).textTheme.body1.copyWith(fontSize: 12.0)
),
)
you can overide text style of spesific element in markdown, code above example to overide p
element from markdown (<p>
element in html)
In 2021 the way to style your main text is:
Markdown(
data: "This is the *way*",
styleSheet: MarkdownStyleSheet.fromTheme(ThemeData(
textTheme: TextTheme(
bodyText2: TextStyle(
fontSize: 20.0, color: Colors.green)))))),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With