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

terminal
1flutter pub add gpt_markdown
main.dart
1import '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

  1. Style sheets and themes change appearance without replacing the renderer.
  2. Builders and callbacks replace supported structures or connect interactions to your app.
  3. Patterns and components turn app-specific tokens such as @mentions into 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

NeedUseWhy
Change colour, size, padding, or fontStyle objectKeeps the package structure and future component improvements.
Replace a component's widget structureBuilderUse 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.text is not the normal widget-test assertion.

Get started

Core guides

Customize

Reference