markdown_widget library

Classes

BlockConfig
BlockquoteConfig
config class for Block quotes, tag: blockquote
BlockquoteNode
Tag: MarkdownTag.blockquote
BrNode
Tag: MarkdownTag.br
CheckBoxConfig
config class for checkbox, tag: input
CodeBlockNode
Tag: MarkdownTag.pre
CodeConfig
config class for code, tag: code
CodeNode
Tag: MarkdownTag.code the code textSpan
ConcreteElementNode
the default concrete node for ElementNode
ContainerConfig
DelNode
Tag: MarkdownTag.del
ElementNode
this node will accept other SpanNode as children
EmNode
Tag: MarkdownTag.em
H1Config
config class for h1
H2Config
config class for h2
H3Config
config class for h3
H4Config
config class for h4
H5Config
config class for h5
H6Config
config class for h6
HeadingConfig
config class for heading
HeadingDivider
only support h1 and h2
HeadingNode
Tag: MarkdownTag.h1 ~ MarkdownTag.h6
HrConfig
config class for HrNode
HrNode
Tag: MarkdownTag.hr
ImageNode
Tag: MarkdownTag.img
ImageViewer
show image with InteractiveViewer
ImgConfig
config class for image, tag: img
InlineConfig
InputNode
Tag: MarkdownTag.input
LeafConfig
LinkConfig
config class for link, tag: a
LinkNode
Tag: MarkdownTag.a
ListConfig
config class for list, tag: li
ListNode
Tag MarkdownTag.li
MarkdownBlock
use MarkdownBlock to build markdown by Column it does not support scrolling by default, but it will adapt to the width automatically.
MarkdownConfig
use MarkdownConfig to set various configurations for MarkdownWidget
MarkdownGenerator
use MarkdownGenerator to transform markdown data to Widget list, so you can render it by any type of ListView
MarkdownWidget
MarkdownWidgetState
MCheckBox
the check box widget
ParagraphNode
Tag: MarkdownTag.p
PConfig
config class for paragraphs, tag: p
PreConfig
config class for pre
ProxyRichText
use ProxyRichText to give textScaleFactor a default value
SpanNode
the basic node
SpanNodeGeneratorWithTag
use SpanNodeGeneratorWithTag that you can custom your own SpanNodeGenerator with tag
StrongNode
Tag: MarkdownTag.strong
TableConfig
TableNode
TBodyNode
TdNode
TextNode
text node only displays text
THeadNode
ThNode
Toc
config for toc
TocController
TocController combines TocWidget and MarkdownWidget, you can use it to control the jump between the two, and each TocWidget corresponds to a MarkdownWidget.
TocItemBuilderData
pass TocItemBuilderData to help build your own TocItemBuilder
TocWidget
TrNode
UlOrOLNode
Tag MarkdownTag.olMarkdownTag.ul
WidgetConfig
WidgetVisitor
use WidgetVisitor that can transform MarkdownNode to SpanNodes and you can use SpanNode with Text.rich or RichText to get widget

Enums

MarkdownTag
the tags of markdown, see https://spec.commonmark.org/0.30/

Properties

headingTag2Level Map<String, int>
every heading tag has a special level
final

Functions

convertHiNodes(List<Node> nodes, Map<String, TextStyle> theme, TextStyle? style, TextStyle? styleNotMatched) List<TextSpan>
getDefaultMarker(bool isOrdered, int depth, Color? color, int index, double paddingTop, MarkdownConfig config) Widget
get default marker for list
highLightSpans(String input, {String? language, bool autoDetectionLanguage = false, Map<String, TextStyle> theme = const {}, TextStyle? textStyle, TextStyle? styleNotMatched, int tabSize = 8}) List<InlineSpan>
transform code to highlight code
wrapByAutoScroll(int index, Widget child, AutoScrollController controller) Widget
wrap widget by AutoScrollTag that can use AutoScrollController to scrollToIndex

Typedefs

CheckBoxBuilder = Widget Function(bool checked)
define a function to return a checkbox widget
CodeBuilder = Widget Function(String code, String language)
CodeWrapper = Widget Function(Widget child, String code, String language)
ErrorImgBuilder = Widget Function(String url, String alt, Object error)
ImgBuilder = Widget Function(String url, Map<String, String> attributes)
ListMarker = Widget? Function(bool isOrdered, int depth, int index)
the function to get marker widget
RichTextBuilder = Widget Function(InlineSpan span)
SpanNodeAcceptCallback = void Function(SpanNode node, int nodeIndex)
when a SpanNope is visited, this callback will be triggered
SpanNodeBuilder = TextSpan Function(SpanNode spanNode)
SpanNodeGenerator = SpanNode Function(Element e, MarkdownConfig config, WidgetVisitor visitor)
use SpanNodeGenerator will return a SpanNode
TextNodeGenerator = SpanNode? Function(Node node, MarkdownConfig config, WidgetVisitor visitor)
use TextNodeGenerator to custom your own TextNode
TocItemBuilder = Widget? Function(TocItemBuilderData data)
use TocItemBuilder to return a custom widget
ValueCallback<T> = void Function(T value)
WidgetWrapper = Widget Function(Widget child)
wrap child by another widget