Default components / Structure
Indented text
Preserves leading-space indentation for indented prose and recursively renders the remaining Markdown.
What it renders
Live Flutter preview
Starting the Flutter widget
Rendering this component with gpt_markdown…
This is the real GptMarkdown Flutter widget, rendered with the exact Markdown input shown here.
Markdown input
1 A short indented note.Default behavior
Runtime behavior
Two or more leading spaces claim the line; the visual indentation is capped at four spaces.
Accessibility note
The content stays selectable text. Use a list or block quote when the indentation conveys a stronger relationship.
Theming & styling
Theme layering guideNo dedicated style object
This built-in is an inline or structural text transformation. It inherits the surrounding text style; replace its syntax only when that behavior itself must change.
App-wide or scoped theme
1// This component has no dedicated style object.
2// It inherits the text style of the surrounding GptMarkdown widget.
3GptMarkdown(
4 markdown,
5 style: Theme.of(context).textTheme.bodyMedium,
6)Builders & callbacks
Safely override the default
A custom component list replaces a default list entirely. Put your matching component first, then append the package defaults so every other Markdown feature continues to render.
1// Passing components replaces its defaults. Prepend to override matching syntax,
2// then keep every built-in component after it.
3GptMarkdown(
4 markdown,
5 components: [
6 MyIndentMdOverride(),
7 ...MarkdownComponent.globalComponents,
8 ],
9)