styleSheet property
The style sheet used to control the visual appearance of rendered markdown.
If not provided, defaults to MarkdownStyleSheet.light. You can use one of the built-in factory constructors:
- MarkdownStyleSheet.light - Clean light theme (default)
- MarkdownStyleSheet.dark - Dark theme for dark mode apps
- MarkdownStyleSheet.github - GitHub-style light or dark theme
- MarkdownStyleSheet.vscode - VS Code editor-style theme
- MarkdownStyleSheet.fromTheme - Adapts to Flutter's theme
You can also create custom styles using MarkdownStyleSheet.copyWith:
styleSheet: MarkdownStyleSheet.light().copyWith(
h1Style: TextStyle(fontSize: 40, color: Colors.purple),
codeBlockDecoration: BoxDecoration(
color: Colors.grey[100],
borderRadius: BorderRadius.circular(8),
),
)
Implementation
final MarkdownStyleSheet? styleSheet;