gpt_markdown은 수식, 표, 링크 및 텍스트 선택을 포함한 풍부한 텍스트 지원 기능을 갖춘 강력한 Flutter 패키지로 마크다운과 라텍스를 렌더링합니다. 채팅 인터페이스와 AI 기반 애플리케이션을 위해 설계되었으며, 안드로이드, iOS, 웹, macOS, Windows, 리눅스에서 고정밀 포맷을 제공합니다. 이 패키지는 ChatGPT나 Gemini와 같은 애플리케이션의 사용자 경험을 향상시켜 구조화된 콘텐츠를 정확하게 표시하고 동적 상호작용을 가능하게 합니다.
사용 사례
AI 채팅 인터페이스
문서 렌더링
수학 콘텐츠 표시
인터랙티브 웹 기반 노트
크로스 플랫폼 앱 콘텐츠
리치 텍스트 메시지
주요 기능
LaTeX 수식 렌더링을 지원합니다
완전한 마크다운 문법 호환성
텍스트 선택 및 복사
반응형 테이블 레이아웃
크로스 플랫폼 일관성
고성능 렌더링
적합한 대상
AI 채팅 앱을 개발하는 개발자
수학 콘텐츠를 포함한 교육 플랫폼
기술 문서 뷰어
풍부한 콘텐츠를 갖춘 모바일 및 웹 앱
일관된 마크다운 출력이 필요한 팀
고려 사항
신뢰할 수 없는 입력을 주의 깊게 처리해야 합니다
매우 큰 문서에 대한 최적화가 필요할 수 있습니다
LaTeX 렌더링은 외부 종속성에 의존합니다
고급 스타일링을 위한 맞춤 설정 제한
정적 또는 반동적 콘텐츠에 가장 적합
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
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.