TxExpandableText constructor

const TxExpandableText(
  1. String data, {
  2. Key? key,
  3. int? collapsedLines,
  4. int? maxLines,
  5. TextStyle? style,
  6. String? collapseButtonLabel,
  7. String? expandButtonLabel,
  8. Widget? collapseIcon,
  9. Widget? expandIcon,
  10. Color? toggleButtonForegroundColor,
  11. TextStyle? toggleButtonTextStyle,
  12. bool? expanded,
  13. bool expandable = true,
  14. StrutStyle? strutStyle,
  15. TextAlign? textAlign,
  16. TextDirection? textDirection,
  17. Locale? locale,
  18. bool? softWrap,
  19. TextScaler? textScaler,
  20. String? semanticsLabel,
  21. TextWidthBasis? textWidthBasis,
  22. TextHeightBehavior? textHeightBehavior,
  23. Color? selectionColor,
  24. ValueChanged<bool>? onToggle,
  25. TxTextOverflow? overflow,
})

创建可展开文本小部件。

如果style参数为空,则文本将使用最接近的封闭DefaultTextStyle中的样式。

data参数不能为空。

Implementation

const TxExpandableText(
  this.data, {
  super.key,
  this.collapsedLines,
  this.maxLines,
  this.style,
  this.collapseButtonLabel,
  this.expandButtonLabel,
  this.collapseIcon,
  this.expandIcon,
  this.toggleButtonForegroundColor,
  this.toggleButtonTextStyle,
  this.expanded,
  this.expandable = true,
  this.strutStyle,
  this.textAlign,
  this.textDirection,
  this.locale,
  this.softWrap,
  this.textScaler,
  this.semanticsLabel,
  this.textWidthBasis,
  this.textHeightBehavior,
  this.selectionColor,
  this.onToggle,
  this.overflow,
});