Default components / Structure

Block quote

Renders one or more quoted lines as a padded quote block with a leading bar.

BlockQuoteblock componentBlockQuoteStyleblockQuoteBuilder

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

input.md
1> A useful detail from the model. 2> It can span more than one line.

Default behavior

Runtime behavior

Quote markers are stripped, then the inner content is rendered as Markdown again.

Accessibility note

Quoted content retains text semantics and is visually separated without relying on color alone.

Theming & styling

Theme layering guide

BlockQuoteStyle is the component's appearance surface. Set only the values you need; style-sheet values merge field-by-field with the active theme and package defaults.

Style classAvailable fields
BlockQuoteStylebarWidth · barColor · barRadius · backgroundColor · padding · margin · textStyle
block-quote_style.dart
1GptMarkdown( 2 markdown, 3 styleSheet: const GptMarkdownStyleSheet( 4 blockQuote: BlockQuoteStyle( 5 barWidth: 4, 6 barColor: Color(0xFF6366F1), 7 backgroundColor: Color(0x0A6366F1), 8 padding: EdgeInsetsDirectional.only(start: 12, top: 8, bottom: 8), 9 ), 10 ), 11)

App-wide or scoped theme

theme.dart
1GptMarkdownThemeData( 2 brightness: Brightness.light, 3 styleSheet: const GptMarkdownStyleSheet( 4 blockQuote: BlockQuoteStyle( 5 // Set only the values your app needs. 6 ), 7 ), 8)

Builders & callbacks

blockQuoteBuilder

Widget Function(BuildContext context, Widget content, BlockQuoteStyle style)

Use this only when the default widget structure is no longer the right shape. The resolved style or configuration is passed where applicable.

Full builder and callback signatures

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.

keep_defaults.dart
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 MyBlockQuoteOverride(), 7 ...MarkdownComponent.globalComponents, 8 ], 9)
Custom component guide

Related components