MarkdownBuilder class

Builds a Widget tree from parsed Markdown.

See also:

  • Markdown, which is a widget that parses and displays Markdown.

Constructors

MarkdownBuilder({required MarkdownBuilderDelegate delegate, required bool selectable, required MarkdownStyleSheet styleSheet, required String? imageDirectory, required MarkdownImageBuilder? imageBuilder, required MarkdownCheckboxBuilder? checkboxBuilder, required MarkdownBulletBuilder? bulletBuilder, required Map<String, MarkdownElementBuilder> builders, required MarkdownListItemCrossAxisAlignment listItemCrossAxisAlignment, bool fitContent = false, VoidCallback? onTapText})
Creates an object that builds a Widget tree from parsed Markdown.

Properties

builders Map<String, MarkdownElementBuilder>
Call when build a custom widget.
final
bulletBuilder MarkdownBulletBuilder?
Called when building a custom bullet.
final
checkboxBuilder MarkdownCheckboxBuilder?
Call when build a checkbox widget.
final
delegate MarkdownBuilderDelegate
A delegate that controls how link and pre elements behave.
final
fitContent bool
Whether to allow the widget to fit the child content.
final
hashCode int
The hash code for this object.
no setterinherited
imageBuilder MarkdownImageBuilder?
Call when build an image widget.
final
imageDirectory String?
The base directory holding images referenced by Img tags with local or network file paths.
final
listItemCrossAxisAlignment MarkdownListItemCrossAxisAlignment
Controls the cross axis alignment for the bullet and list item content in lists.
final
onTapText VoidCallback?
Default tap handler used when selectable is set to true
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectable bool
If true, the text is selectable.
final
styleSheet MarkdownStyleSheet
Defines which TextStyle objects to use for each type of element.
final

Methods

build(List<Node> nodes) List<Widget>
Returns widgets that display the given Markdown nodes.
extractTextFromElement(Node element) String?
Returns the text, if any, from element and its descendants.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
visitElementAfter(Element element) → void
Called when an Element has been reached, after its children have been visited.
visitElementBefore(Element element) bool
Called when an Element has been reached, before its children have been visited.
visitText(Text text) → void
Called when a Text node has been reached.

Operators

operator ==(Object other) bool
The equality operator.
inherited