RText constructor
RText({
- Key? key,
- required List<
String> texts, - TextStyle? style,
- List<
TextStyle?> styles = const [], - List<
GestureRecognizer?> recognizers = const [], - List<
String?> semanticsLabels = const [], - List<
MouseCursor?> mouseCursors = const [], - List<
PointerEnterEventListener?> onEnters = const [], - List<
PointerExitEventListener?> onExits = const [], - List<
Locale?> locales = const [], - List<
bool?> spellOuts = const [], - StrutStyle? strutStyle,
- TextAlign textAlign = TextAlign.center,
- TextDirection? textDirection,
- Locale? locale,
- bool softWrap = true,
- TextOverflow overflow = TextOverflow.clip,
- TextScaler textScaler = TextScaler.noScaling,
- int? maxLines,
- TextWidthBasis textWidthBasis = TextWidthBasis.parent,
- TextHeightBehavior? textHeightBehavior,
- SelectionRegistrar? selectionRegistrar,
- Color? selectionColor,
Implementation
RText({
super.key,
/// 文本
required List<String> texts,
/// 所有[texts]默认样式
TextStyle? style,
/// [texts]内样式
List<TextStyle?> styles = const [],
/// [texts]内手势
List<GestureRecognizer?> recognizers = const [],
/// [texts]内语义 - 语义描述标签,相当于此text的别名
List<String?> semanticsLabels = const [],
/// [mouseCursors]
List<MouseCursor?> mouseCursors = const [],
/// [onEnters]
List<PointerEnterEventListener?> onEnters = const [],
/// [onExits]
List<PointerExitEventListener?> onExits = const [],
/// [locales]
List<Locale?> locales = const [],
/// [spellOuts]
List<bool?> spellOuts = const [],
/// StrutStyle,影响Text在垂直方向上的布局
super.strutStyle,
/// TextAlign,内容对齐方式
super.textAlign = TextAlign.center,
/// TextDirection,内容的走向方式
super.textDirection,
/// Locale,当相同的Unicode字符可以根据不同的地区以不同的方式呈现时,用于选择字体
super.locale,
/// bool 文本是否应在软换行时断行
super.softWrap = true,
/// TextOverflow,内容溢出时的处理方式
super.overflow = TextOverflow.clip,
/// double 设置文字的放大缩小,例如,fontSize=10,this.textScaleFactor=2.0,最终得到的文字大小为10*2.0
super.textScaler = TextScaler.noScaling,
/// int 设置文字的最大展示行数
super.maxLines,
/// TextWidthBasis 测量一行或多行文本宽度
super.textWidthBasis = TextWidthBasis.parent,
super.textHeightBehavior,
super.selectionRegistrar,
super.selectionColor,
}) : super(
text: buildTextSpan(buildTextSpans(
texts: texts,
style: style,
styles: styles,
semanticsLabels: semanticsLabels,
recognizers: recognizers,
mouseCursors: mouseCursors,
onEnters: onEnters,
onExits: onExits,
locales: locales,
spellOuts: spellOuts)));