Orientação gerada a partir de informações públicas. Apenas para referência.
gpt_markdown é um poderoso pacote Flutter para renderizar Markdown e LaTeX com suporte a texto rico, incluindo expressões matemáticas, tabelas, links e seleção de texto. Projetado para interfaces de chat e aplicações com inteligência artificial, oferece formatação de alta fidelidade em Android, iOS, Web, macOS, Windows e Linux. O pacote melhora a experiência do usuário em aplicativos como ChatGPT ou Gemini ao exibir com precisão conteúdo estruturado com interatividade dinâmica.
Casos de uso
Interfaces de chat com IA
Renderização de documentação
exibição de conteúdo matemático
Notas interativas baseadas na web
Conteúdo de aplicativo multiplataforma
mensagens de texto rico
Principais recursos
Suporta renderização matemática LaTeX
Compatibilidade completa com sintaxe do Markdown
Seleção e cópia de texto
Layouts de tabela responsivos
Consistência entre plataformas
Renderização de alto desempenho
Indicado para
Desenvolvedores de aplicativos de chat com IA
Plataformas educacionais com conteúdo de matemática
Visualizadores de documentação técnica
Aplicativos móveis e web ricos em conteúdo
Equipes que precisam de saída consistente em Markdown
Considerações
Requer manipulação cuidadosa de entrada não confiável
Pode ser necessário otimizar documentos muito grandes
A renderização do LaTeX depende de dependências externas
Personalização limitada para estilos avançados
Mais adequado para conteúdo estático ou semi-dinâmico
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
gpt_markdown
The Flutter renderer for AI output.
Production-grade Markdown and LaTeX rendering for streaming Flutter AI interfaces.
Render rich assistant replies, math, code, tables, citations, images, and custom inline UI in one widget.
Built for AI output — Markdown, LaTeX, code blocks, tables, citations, images, task lists, and mixed rich content in one response.
Streaming that stays fast — settled segments are reused while the live tail updates. At 12 KB, each update is 31× faster than in 1.2.1—or 74× faster with the lazy sliver. See the benchmarks.
Production-level control — style sheets, Flutter theme extensions, component builders, callbacks, and custom components.
Extensible inline UI — add @mentions, #channels, :emoji:, issue references, and product-specific syntax without forking the renderer.
Designed for real-world edge cases — RTL, text scaling, selection, malformed Markdown, autolinks, nested content, reduced motion, Flutter web, and WASM.
🧩 Everything AI output needs
Rendering
Production experience
Extensibility
📝
Rich Markdown
⚡
Adaptive streaming
🎨
Component style sheet
∑
Inline and block LaTeX
🚀
Lazy sliver rendering
🧱
Structural builders
💻
Syntax-highlighted code
♿
Selection and text scaling
🏷️
Mentions, channels, and emoji
📊
Tables and aligned columns
🌍
RTL, web, and WASM
🧩
Custom components and scopes
🔗
Links, autolinks, and images
🌓
Theme-aware rendering
👆
Interaction callbacks
☑️
Lists, tasks, and citations
🛡️
Graceful malformed input
📱
Custom URL schemes
🖼️ What it renders
Every image is one GptMarkdown widget with no styling applied — the defaults, in a dark theme. Click any of them for full size.
Rich text Headings, emphasis, lists, quotes, rules, autolinks.
LaTeX Inline and display equations, on the text baseline.
The reveal adapts to incoming text, finishes when generation ends, and respects reduced-motion settings. See the streaming guide for animation modes and configuration.
For long responses and documents, use SliverGptMarkdown inside a
CustomScrollView. It creates spans and widgets only for the segments requested
by the viewport, including its cache extent. The regular GptMarkdown widget is
cheaper for short content and remains the option for character reveal. See the
rendering architecture guide.
Use \( ... \) for inline LaTeX and \[ ... \] for block equations. Enable dollar-sign syntax with useDollarSignsForLatex: true. Code fences include syntax highlighting, language labels, and copy controls.
Wrap the renderer with SelectionArea when selectable output is needed:
SelectionArea(
child: GptMarkdown(reply),
)
🎨 Make it match your product
Use style objects for appearance and builders when you need to replace structure.
Set styles app-wide with GptMarkdownThemeData. Use builders such as codeBuilder, tableBuilder, and imageBuilder to replace components, or span-based builders for links, citations, and inline code. See customization.
🏷️ App-specific inline UI
Render mentions, channels, emoji, issue references, and other product syntax alongside Markdown:
Only known channel names are matched, longest-first. Patterns exclude link labels by default; unrecognized tokens such as #2959 remain text.
Use blockComponents for custom blocks and inlineDirectives for payloads the parser must leave untouched. See custom components.
Upgrading? Passing components or inlineComponents, even an empty list, selects the deprecated legacy parser. Replace them to use the new pipeline. See the migration guide and changelog.
🔗 Autolinks
Bare URLs, www. hosts, emails, and angle autolinks work automatically. Add custom schemes with autolinkSchemes: const {'myapp'}, or disable autolinking with autolink: false. Explicit [label](url) links still work. See inline syntax.