Markdown class

A component that parses and renders markdown content as a Jaspr component.

Supports defining a custom md.Document to use for parsing, as well as a list of custom components that can be used in the markdown content.

The rendered markdown is wrapped in a Content section and has a default set of typographic styles applied, which can be customized by providing a ContentTheme somewhere up the component tree using Content.wrapTheme(ContentTheme(...), child).

Constructors

Markdown.new({required String content, Document? document, List<CustomComponent> components = const []})

Properties

components List<CustomComponent>
A list of custom components to use in the markdown.
final
content String
The markdown content to render.
final
document → Document?
The markdown document to use.
final
hashCode int
The hash code for this object.
no setterinherited
key → Key?
Controls how one component replaces another component in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) → Component
Describes the part of the user interface represented by this component.
createElement() → Element
Creates a StatelessElement to manage this component's location in the tree.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRebuild(covariant Component newComponent) bool
Implement this method to determine whether a rebuild can be skipped.
inherited
toString() String
A string representation of this object.
inherited

Operators

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