fat_markdown

Run Example

A powerful Flutter Markdown widget with LaTeX math and syntax highlighting.

Features

  • πŸ“ Full GitHub-Flavoured Markdown (GFM)
  • βž— Inline and block LaTeX via flutter_math_fork
  • 🎨 Syntax highlighting for 14 languages (Dart, JS/TS, Python, Go, Rust, SQL…)
  • πŸŒ™ Automatic light/dark theme detection for code blocks
  • πŸ“‹ Copy-to-clipboard button in every code block
  • πŸ–ΌοΈ Image tap handler with gallery support
  • πŸ“Š Tables with stretch/scroll mode
  • βœ… GitHub-style checkboxes
  • πŸ”— Tappable links
  • 🐞 Built-in tree-view debug mode
  • 🎨 Fully themeable via FatMarkdownTheme (ThemeExtension)

Installation

dependencies:
  fat_markdown: ^0.9.1

Usage

import 'package:fat_markdown/fat_markdown.dart';

FatMarkdown(
  data: '# Hello\n\nThis is **fat** markdown with $E=mc^2$.',
  onLinkTap: (url) => launchUrl(Uri.parse(url)),
  onImageTap: (url, allImages) { /* open gallery */ },
)

Theming

Customise via FatMarkdownTheme in your ThemeData.extensions:

MaterialApp(
  theme: ThemeData(
    extensions: [
      FatMarkdownTheme(
        codeFontSize: 14,
        tableStretch: true,
        codeBlockDividerColor: Colors.transparent, // hide divider
      ),
    ],
  ),
)

Debug Mode

Inspect the parsed AST with the built-in tree-view:

FatMarkdown(
  data: markdownString,
  mode: FatMarkdownMode.treeview,
)

License

MIT Β© 2026 damphat

Libraries

fat_markdown
fat_markdown β€” A powerful Flutter Markdown widget with LaTeX and syntax highlighting.