Aus öffentlichen Paketdaten erstellte Orientierung.
gpt_markdown ist ein leistungsstarkes Flutter-Paket zum Rendern von Markdown und LaTeX mit umfassender Textunterstützung, einschließlich mathematischer Ausdrücke, Tabellen, Links und Textauswahl. Speziell für Chat-Oberflächen und künstliche Intelligenz-Anwendungen entwickelt, bietet es hochwertige Formatierung auf Android, iOS, Web, macOS, Windows und Linux. Das Paket verbessert die Benutzererfahrung in Anwendungen wie ChatGPT oder Gemini, indem es strukturierte Inhalte präzise mit dynamischer Interaktivität darstellt.
Anwendungsfälle
AI-Chat-Schnittstellen
Dokumentationen-Rendern
Anzeige mathematischer Inhalte
Interaktive webbasierte Notizen
Plattformübergreifender App-Inhalt
reicher Text Nachrichten
Hauptmerkmale
Unterstützt LaTeX-Mathematik-Rendering
Vollständige Kompatibilität mit der Markdown-Syntax
Textauswahl und Kopieren
Reaktive Tabellenlayouts
Plattformübergreifende Konsistenz
Leistungsstarke Rendering
Geeignet für
Entwickler, die AI-Chatsysteme erstellen
Bildungsplattformen mit Mathematikinhalten
Technische Dokumentationsansicht
Inhaltsreiche mobile und Web-Anwendungen
Teams, die konsistente Markdown-Ausgabe benötigen
Hinweise
Erfordert sorgfältige Behandlung von unvertrauenswürdigen Eingaben
Könnte bei sehr großen Dokumenten Optimierung erfordern
Die LaTeX-Wiedergabe hängt von externen Abhängigkeiten ab
Eingeschränkte Anpassungsmöglichkeiten für fortgeschrittene Gestaltung
Am besten geeignet für statischen oder halb-dynamischen Inhalt
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
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.