Style & Parameters

Complete reference for every parameter on the GptMarkdown widget.

Full signature

reference.dart
1GptMarkdown( 2 'your markdown string', // required, positional 3 4 // Text 5 style: TextStyle(...), // base text style 6 textDirection: TextDirection.ltr, // LTR (default) or RTL 7 textAlign: TextAlign.start, // text alignment 8 textScaler: TextScaler.linear(1), // text scaling 9 maxLines: null, // max lines (null = unlimited) 10 overflow: TextOverflow.clip, // overflow behaviour 11 12 // Links 13 onLinkTap: (url, title) { }, // handle link taps 14 followLinkColor: false, // inherit link color from style 15 linkBuilder: (ctx, text, href, title) => Widget, 16 17 // LaTeX 18 useDollarSignsForLatex: false, // enable $...$ and $$...$$ syntax 19 latexWorkaround: (tex) => tex, // normalize AI output quirks 20 latexBuilder: (ctx, latex, style, inline) => Widget, 21 22 // Code blocks 23 codeBuilder: (ctx, lang, code, closed) => Widget, 24 25 // Inline code / highlight 26 highlightBuilder: (ctx, code, style) => Widget, 27 28 // Images 29 imageBuilder: (ctx, url, alt) => Widget, 30 31 // Lists 32 orderedListBuilder: (ctx, num, style) => Widget, 33 unOrderedListBuilder: (ctx, depth, style) => Widget, 34 35 // Tables 36 tableBuilder: (ctx, headers, rows) => Widget, 37 38 // Source tags (citations) 39 sourceTagBuilder: (ctx, sources) => Widget, 40 41 // Custom block-level components 42 components: [...], 43 44 // Custom inline components 45 inlineComponents: [...], 46)

Parameter reference

ParameterTypeReq.Description
dataStringThe Markdown string to render. Positional argument.
styleTextStyle?Base text style applied to all text.
textDirectionTextDirectionLTR (default) or RTL — for Arabic, Hebrew, etc.
textAlignTextAlign?Text alignment within the widget.
textScalerTextScaler?Scales text size uniformly.
maxLinesint?Limits number of rendered lines.
overflowTextOverflow?Overflow behaviour when maxLines is set.
followLinkColorboolIf true, links inherit the base text color.
onLinkTapFunction(url, title)?Callback when a Markdown link is tapped.
linkBuilderLinkBuilder?Fully replace the link widget.
useDollarSignsForLatexboolEnable $...$ and $$...$$ LaTeX delimiters.
latexWorkaroundFunction(String)?Transform LaTeX strings before rendering (e.g. unescape).
latexBuilderLatexBuilder?Replace the LaTeX renderer with your own widget.
codeBuilderCodeBlockBuilder?Replace the code block renderer.
highlightBuilderHighlightBuilder?Replace inline code (backtick) renderer.
imageBuilderImageBuilder?Replace the image renderer.
orderedListBuilderOrderedListBuilder?Replace the ordered list item renderer.
unOrderedListBuilderUnOrderedListBuilder?Replace the unordered list item renderer.
tableBuilderFunction?Replace the table renderer.
sourceTagBuilderSourceTagBuilder?Render citation/source tags.
componentsList?Custom block-level Markdown components.
inlineComponentsList?Custom inline Markdown components.