RichTextGenerator class
富文本填充生成器 用于链式去生成富文本样式的文案 如果是直接的标签可以用css
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addIcon(
Widget? icon, {PlaceholderAlignment? alignment}) → RichTextGenerator -
icon
图标alignment
图标的对齐方式 默认是顶部对齐 -
addText(
String text, {TextStyle? textStyle, double? fontSize, Color? color, FontWeight? fontWeight}) → RichTextGenerator -
添加自定义文案
text
显示的文案textStyle
文案的样式fontWeight
字体的粗细 默认是 normalfontSize
文案大小 默认是16color
文案的颜色 默认是深黑色 -
addTextWithLink(
String text, {String? url, TextStyle? textStyle, Color? linkColor, double? fontSize, FontWeight? fontWeight, HyperLinkCallback? richTextLinkClick}) → RichTextGenerator -
添加超链接部分的文案
text
显示的文案url
超链接的 urltextStyle
文案的样式linkColor
超链接的颜色fontSize
显示大小fontWeight
字体粗细richTextLinkClick
超链接点击的回调 -
build(
) → Widget - build出福文本
-
clear(
) → void - 清空文案
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setMaxLines(
int maxLine) → RichTextGenerator - 设置最多文案显示几行 默认是100行
-
setTextOverflow(
TextOverflow overflow) → RichTextGenerator - 设置文案溢出的样式
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited