RichTextSpan class

富文本(应用于帖子列表、详情)

Inheritance

Constructors

RichTextSpan({Key? key, String text = '', double fontSize = 13, Color fontColor = const Color(0xe6333333), FontWeight fontWeight = FontWeight.normal, String ellipsis = "", int maxLines = 4, double lineHeight = 1.2, double letterSpacing = 0.5, double lineSpacing = 2, double emojiSize = 20.0, Color atFontColor = Colors.blue, double atFontSize = 16.0, Color linkFontColor = Colors.blue, double linkFontSize = 16.0, Map<String, dynamic>? extrasMap, OnTagCall? onTagCall, TagArguments? startTagItems, String? moreText, Color moreTextColor = Colors.blue, OnMoreTagCall? onMoreTagCall, TextStyle? colorTagStyle, bool isMarkPinyin = false, Map<String, dynamic> wordsPinyinMap = const {}, dynamic buildCall(RichTextSpanModel model)?, dynamic pinYinParsingCall()?, bool enablePinYinCheck = false, Color markTextColor = const Color(0xe6333333), double markTextSize = 12, List<Map<List<int>, TextSpanStyle>> indexRangeStyle = const [], TextAlign? textAlign, Iterable<int>? customWordIndex, OnCustomWordCall? customWordCall, bool selectionEnabled = false, Color? selectionToolBarColor = const Color(0xcc3B372C), List<TextSelectionToolbarItemData>? selectionToolBarItems, double? selectionToolBarHeight, List<String>? referenceMarkList, OnReferenceWordCall? referenceWordCall})
const

Properties

atFontColor → Color
@字体颜色(默认blue)
final
atFontSize → double
@字体大小(默认16)
final
buildCall → dynamic Function(RichTextSpanModel model)?
构建完成回调
final
colorTagStyle → TextStyle?
color标签style
final
customWordCall → OnCustomWordCall?
自定义字回调
final
customWordIndex → Iterable<int>?
自定义字索引
final
ellipsis → String
超出最大长度时显示的省略文本(默认...)
final
emojiSize → double
emoji表情大小(默认20.0)
final
enablePinYinCheck → bool
启用拼音检测
final
extrasMap → Map<String, dynamic>?
扩展map(用于携带自定义数据)
final
fontColor → Color
文本字体颜色(默认#222222)
final
fontSize → double
文本字体大小(默认16)
final
fontWeight → FontWeight
字体权重
final
hashCode → int
The hash code for this object.
no setterinherited
indexRangeStyle → List<Map<List<int>, TextSpanStyle>>
根据标注的索引范围设置对应的样式
final
isMarkPinyin → bool
是否标注拼音
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
letterSpacing → double
字符间距(默认0.5)
final
lineHeight → double
行高(默认1.2)
final
lineSpacing → double
行间距(默认2)
final
linkFontColor → Color
链接颜色(默认blue)
final
linkFontSize → double
链接字体大小(默认16)
final
markTextColor → Color
标记文本颜色
final
markTextSize → double
标记文本大小
final
maxLines → int
最大行数(默认4行)
final
moreText → String?
更多标签文本
final
moreTextColor → Color
更多文本颜色(默认blue)
final
onMoreTagCall → OnMoreTagCall?
更多标签事件回调
final
onTagCall → OnTagCall?
标签事件回调
final
pinYinParsingCall → dynamic Function()?
解析拼音回调
final
referenceMarkList → List<String>?
引用标记列表,在文中显注标记该集合的数据;
final
referenceWordCall → OnCustomWordCall?
引用文本回调
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectionEnabled → bool
是否启用文本选择
final
selectionToolBarColor → Color?
文本选择工具条颜色
final
selectionToolBarHeight → double?
工具条高度
final
selectionToolBarItems → List<TextSelectionToolbarItemData>?
工具条选项集合
final
startTagItems → TagArguments?
文本开始标签
final
text → String
处理的文本内容
final
textAlign → TextAlign?
文本对齐方式
final
wordsPinyinMap → Map<String, dynamic>
字拼音map
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
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
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