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.
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,
),
);
}
}
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: