DjangoflowMarkdownCharacterTruncate class

generate docs

This widget truncates the markdown content based on the number of characters. If the content exceeds the specified number of characters, the content is truncated and a "Read more" link is displayed. The "Read more" link is clickable and triggers the onReadMoreTapped callback. The maxCharacters parameter specifies the maximum number of characters to display. If the maxCharacters parameter is null, the content is displayed without truncation. The shrinkWrap parameter specifies whether the widget should shrink-wrap its content. If the shrinkWrap parameter is true, the widget will be wrapped in a ListView with shrinkWrap set to true. If the shrinkWrap parameter is false, the widget will be wrapped in a Column with shrinkWrap set to false. The onReadMoreTapped callback is triggered when the "Read more" link is tapped. The onReadMoreTapped callback is optional. The rest of the parameters are the same as the MarkdownBody widget.

Inheritance

Constructors

DjangoflowMarkdownCharacterTruncate({required String data, Key? key, int? maxCharacters, bool selectable = false, MarkdownStyleSheet? styleSheet, MarkdownStyleSheetBaseTheme? styleSheetTheme = null, SyntaxHighlighter? syntaxHighlighter, MarkdownTapLinkCallback? onTapLink, VoidCallback? onTapText, String? imageDirectory, List<BlockSyntax>? blockSyntaxes, List<InlineSyntax>? inlineSyntaxes, ExtensionSet? extensionSet, MarkdownImageBuilder? imageBuilder, MarkdownCheckboxBuilder? checkboxBuilder, Map<String, MarkdownElementBuilder> builders = const <String, MarkdownElementBuilder>{}, MarkdownListItemCrossAxisAlignment listItemCrossAxisAlignment = MarkdownListItemCrossAxisAlignment.baseline, bool shrinkWrap = true, bool fitContent = true, VoidCallback? onReadMoreTapped})
const

Properties

blockSyntaxes List<BlockSyntax>?
Collection of custom block syntax types to be used parsing the Markdown data.
finalinherited
builders Map<String, MarkdownElementBuilder>
Render certain tags, usually used with extensionSet
finalinherited
bulletBuilder → MarkdownBulletBuilder?
Called when building a bullet
finalinherited
checkboxBuilder → MarkdownCheckboxBuilder?
Call when build a checkbox widget.
finalinherited
data String
The Markdown to display.
finalinherited
extensionSet → ExtensionSet?
Markdown syntax extension set
finalinherited
fitContent bool
Whether to allow the widget to fit the child content.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
imageBuilder → MarkdownImageBuilder?
Called to build an image widget.
finalinherited
imageDirectory String?
The base directory holding images referenced by Img tags with local or network file paths.
finalinherited
inlineSyntaxes List<InlineSyntax>?
Collection of custom inline syntax types to be used parsing the Markdown data.
finalinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listItemCrossAxisAlignment → MarkdownListItemCrossAxisAlignment
Controls the cross axis alignment for the bullet and list item content in lists.
finalinherited
maxCharacters int?
final
onReadMoreTapped VoidCallback?
finalinherited
onSelectionChanged → MarkdownOnSelectionChangedCallback?
Called when the user changes selection when selectable is set to true.
finalinherited
Called when the user taps a link.
finalinherited
onTapText VoidCallback?
Default tap handler used when selectable is set to true
finalinherited
paddingBuilders Map<String, MarkdownPaddingBuilder>
Add padding for different tags (use only for block elements and img)
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectable bool
If true, the text is selectable.
finalinherited
shrinkWrap bool
If shrinkWrap is true, MarkdownBody will take the minimum height that wraps its content. Otherwise, MarkdownBody will expand to the maximum allowed height.
finalinherited
sizedImageBuilder → MarkdownSizedImageBuilder?
Called to build an image widget with size information.
finalinherited
softLineBreak bool
The soft line break is used to identify the spaces at the end of aline of text and the leading spaces in the immediately following the line of text.
finalinherited
styleSheet → MarkdownStyleSheet?
The styles to use when displaying the Markdown.
finalinherited
styleSheetTheme → MarkdownStyleSheetBaseTheme?
Setting to specify base theme for MarkdownStyleSheet
finalinherited
syntaxHighlighter → SyntaxHighlighter?
The syntax highlighter used to color text in pre elements.
finalinherited

Methods

build(BuildContext context, List<Widget>? children) Widget
Subclasses should override this function to display the given children, which are the parsed representation of data.
buildReadMoreSpan(TextStyle? defaultStyle, TextStyle? anchorStyle) List<TextSpan>
inherited
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MarkdownWidget>
Creates the mutable state for this widget at a given location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
findWidgetsOfType<T>(Widget widget) List<T>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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