Open JCKodel opened 1 year ago
Currently, the default text style doesn't reflect the current app theme.
The idea is to exchange Text("something") with MarkdownViewer("something") and have the exact same output.
Text("something")
MarkdownViewer("something")
In my projects, I had to create a wrapper for it:
class Markdown extends StatelessWidget { const Markdown(this.text, {this.style, super.key}); final String text; final TextStyle? style; @override Widget build(BuildContext context) { return MarkdownViewer( text, selectable: false, styleSheet: MarkdownStyle( textStyle: style ?? Theme.of(context).textTheme.bodyMedium, ), ); } }
Thanks for your feedback. I might add a static method fromTheme(ThemeData theme) to MarkdownStyle later.
fromTheme(ThemeData theme)
MarkdownStyle
Currently, the default text style doesn't reflect the current app theme.
The idea is to exchange
Text("something")
withMarkdownViewer("something")
and have the exact same output.In my projects, I had to create a wrapper for it: