GptMarkdownConfig class
A configuration class for the GPT Markdown component.
The GptMarkdownConfig class is used to configure the GPT Markdown component. It takes a style parameter to set the style of the text, a textDirection parameter to set the direction of the text, and an optional onLinkTap parameter to handle link clicks.
Constructors
-
GptMarkdownConfig({TextStyle? style, TextDirection textDirection = TextDirection.ltr, void onLinkTap(String url, String title)?, TextAlign? textAlign, TextScaler? textScaler, String latexWorkaround(String tex)?, LatexBuilder? latexBuilder, bool followLinkColor = false, CodeBlockBuilder? codeBuilder, InlineSourceTagBuilder? inlineSourceTagBuilder, @Deprecated('Use inlineSourceTagBuilder. Will be removed in 2.0.0.') SourceTagBuilder? sourceTagBuilder, List<
InlineDirective> ? inlineDirectives, InlineCodeBuilder? inlineCodeBuilder, @Deprecated('Use inlineCodeBuilder. Will be removed in 2.0.0.') HighlightBuilder? highlightBuilder, OrderedListBuilder? orderedListBuilder, UnOrderedListBuilder? unOrderedListBuilder, bool blocksRenderDirectly = false, InlineLinkBuilder? inlineLinkBuilder, @Deprecated('Use inlineLinkBuilder. Will be removed in 2.0.0.') LinkBuilder? linkBuilder, ImageBuilder? imageBuilder, int? maxLines, TextOverflow? overflow, List<MarkdownComponent> ? components, List<MarkdownComponent> ? inlineComponents, List<InlinePattern> ? inlinePatterns, List<MarkdownBlockComponent> ? blockComponents, TableBuilder? tableBuilder, InlineCodeStyle? inlineCodeStyle, GptMarkdownStyleSheet? styleSheet, BlockQuoteBuilder? blockQuoteBuilder, HeadingBuilder? headingBuilder, CheckboxBuilder? checkboxBuilder, RadioOptionBuilder? radioOptionBuilder, HrBuilder? hrBuilder, void onCheckboxChanged(bool value)?, void onCodeCopy(String code)?, void onImageTap(String code)?, void onSourceTagTap(String code)?, bool autolink = true, Set<String> autolinkSchemes = const <String>{}, MarkdownScope scope = MarkdownScope.content}) -
const
Properties
- autolink → bool
-
Whether bare URLs,
www.hosts, emails and<...>autolinks are linked.final -
autolinkSchemes
→ Set<
String> -
Extra URL schemes linked without
<>. See GptMarkdown.autolinkSchemes.final -
blockComponents
→ List<
MarkdownBlockComponent> ? -
Modern block syntax extensions. Legacy component lists take precedence.
final
- blockQuoteBuilder → BlockQuoteBuilder?
-
Replaces the whole blockquote widget.
final
- blockRegistry → MarkdownBlockRegistry?
-
Components must be treated as immutable after registration.
no setter
-
blockRenderers
→ Map<
String, MarkdownBlockBuilder> -
no setter
- blocksRenderDirectly → bool
-
Whether a block construct is rendered as a sibling widget rather than as
a placeholder inside a paragraph.
final
- checkboxBuilder → CheckboxBuilder?
-
Replaces the whole checkbox row.
final
- codeBuilder → CodeBlockBuilder?
-
The code builder.
final
-
components
→ List<
MarkdownComponent> ? -
The list of components.
final
- followLinkColor → bool
-
Whether to follow the link color.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headingBuilder → HeadingBuilder?
-
Replaces the whole heading widget.
final
- highlightBuilder → HighlightBuilder?
-
Builds a widget for inline
`code`.final - hrBuilder → HrBuilder?
-
Replaces the horizontal rule.
final
- imageBuilder → ImageBuilder?
-
The image builder.
final
- inlineCodeBuilder → InlineCodeBuilder?
-
Builds the span for inline
`code`, overriding the default chip.final - inlineCodeStyle → InlineCodeStyle?
-
Overrides the themed inline
codestyle for this widget only.final -
inlineComponents
→ List<
MarkdownComponent> ? -
The list of inline components.
final
-
inlineDirectives
→ List<
InlineDirective> ? -
Host-defined inline regions the parser must not look inside.
final
- inlineLinkBuilder → InlineLinkBuilder?
-
Builds the span for a link, replacing the default rendering.
final
-
inlinePatterns
→ List<
InlinePattern> ? -
App-specific inline syntaxes. See GptMarkdown.inlinePatterns.
final
- inlineSourceTagBuilder → InlineSourceTagBuilder?
-
Builds the span for a
[1]citation chip, replacing the default chip.final - latexBuilder → LatexBuilder?
-
The LaTeX builder.
final
- latexWorkaround → String Function(String tex)?
-
The LaTeX workaround.
final
- linkBuilder → LinkBuilder?
-
Builds a widget for a link.
final
- maxLines → int?
-
The maximum number of lines.
final
- onCheckboxChanged → void Function(bool value)?
-
Called when a task-list checkbox is tapped.
final
- onCodeCopy → void Function(String code)?
-
Called with the code after a code block's copy button is used.
final
- onImageTap → void Function(String code)?
-
Called with the image URL when an image is tapped.
final
- onLinkTap → void Function(String url, String title)?
-
The callback function to handle link clicks.
final
- onSourceTagTap → void Function(String code)?
-
Called with the tag content when a
[1]citation chip is tapped.final - orderedListBuilder → OrderedListBuilder?
-
The Ordered List builder.
final
- overflow → TextOverflow?
-
The overflow.
final
- radioOptionBuilder → CheckboxBuilder?
-
Replaces the whole radio row.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scope → MarkdownScope
-
The nesting context the current text is being rendered in.
final
- sourceTagBuilder → HighlightBuilder?
-
Builds a widget for a
[1]citation chip.final - style → TextStyle?
-
The style of the text.
final
- styleSheet → GptMarkdownStyleSheet?
-
Per-component appearance for this widget. See GptMarkdown.styleSheet.
final
- tableBuilder → TableBuilder?
-
The table builder.
final
- textAlign → TextAlign?
-
The alignment of the text.
final
- textDirection → TextDirection
-
The direction of the text.
final
- textScaler → TextScaler?
-
The text scaler.
final
- unOrderedListBuilder → UnOrderedListBuilder?
-
The Unordered List builder.
final
Methods
-
copyWith(
{TextStyle? style, TextDirection? textDirection, void onLinkTap(String url, String title)?, TextAlign? textAlign, TextScaler? textScaler, String latexWorkaround(String tex)?, LatexBuilder? latexBuilder, InlineSourceTagBuilder? inlineSourceTagBuilder, SourceTagBuilder? sourceTagBuilder, List< InlineDirective> ? inlineDirectives, bool? followLinkColor, CodeBlockBuilder? codeBuilder, int? maxLines, TextOverflow? overflow, InlineCodeBuilder? inlineCodeBuilder, HighlightBuilder? highlightBuilder, bool? blocksRenderDirectly, InlineLinkBuilder? inlineLinkBuilder, LinkBuilder? linkBuilder, ImageBuilder? imageBuilder, OrderedListBuilder? orderedListBuilder, UnOrderedListBuilder? unOrderedListBuilder, List<MarkdownComponent> ? components, List<MarkdownComponent> ? inlineComponents, List<InlinePattern> ? inlinePatterns, List<MarkdownBlockComponent> ? blockComponents, TableBuilder? tableBuilder, InlineCodeStyle? inlineCodeStyle, GptMarkdownStyleSheet? styleSheet, BlockQuoteBuilder? blockQuoteBuilder, HeadingBuilder? headingBuilder, CheckboxBuilder? checkboxBuilder, RadioOptionBuilder? radioOptionBuilder, HrBuilder? hrBuilder, void onCheckboxChanged(bool value)?, void onCodeCopy(String code)?, void onImageTap(String code)?, void onSourceTagTap(String code)?, bool? autolink, Set<String> ? autolinkSchemes, MarkdownScope? scope}) → GptMarkdownConfig - A copy of the configuration with the specified parameters.
-
getRich(
InlineSpan span, {bool isRoot = false, bool ambientScaling = false}) → Widget - A method to get a rich text widget from an inline span.
-
isSame(
GptMarkdownConfig other) → bool - A method to check if the configuration is the same.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited