gpt_markdown documentation
The complete guide to gpt_markdown. Start with one widget, then learn every supported rendering behavior, customization layer, inline extension point, test strategy, and migration consideration.
Quick start
1flutter pub add gpt_markdown1import 'package:gpt_markdown/gpt_markdown.dart';
2
3GptMarkdown(
4 r'**Hello!** Inline math: \( E = mc^2 \)',
5)This renders common Markdown and LaTeX immediately. Use a latexBuilder only when your app needs to replace the default math widget.
Three ways to customize
- Style sheets and themes change appearance without replacing the renderer.
- Builders and callbacks replace supported structures or connect interactions to your app.
- Patterns and components turn app-specific tokens such as
@mentionsinto native inline UI.
Complete package coverage
These pages cover the package's full documentation set in the website itself: getting started, customization, streaming, inline syntax, custom components, testing, and migration—alongside focused rendering and API references.
How to choose a customization tool
| Need | Use | Why |
|---|---|---|
| Change colour, size, padding, or font | Style object | Keeps the package structure and future component improvements. |
| Replace a component's widget structure | Builder | Use only when the default structure is genuinely not enough. |
- A WidgetSpan inside a link label does not paint on iOS; declare safe scopes for custom components.
- Changing a builder at runtime needs a remount because closures are not compared for span caching.
- Markdown text lives in spans, so
find.textis not the normal widget-test assertion.
Get started
Core guides
See the supported Markdown, citations, links, lists, tables, and more.
Use autolinks, app URL schemes, mentions, channels, emoji, and safe text spans.
Reveal a reply as it arrives, then finish cleanly.
Render equations, choose delimiters, and handle wide formulas.
Control fenced code, copy actions, and incomplete streamed fences.
