ExpandableText.lines constructor

ExpandableText.lines(
  1. String text, {
  2. required int? lines,
  3. Color? arrowColor,
  4. double arrowSize = 24,
  5. ArrowBuilder? arrowWidgetBuilder,
  6. Duration animationDuration = const Duration(milliseconds: 150),
  7. TextStyle? textStyle,
  8. StrutStyle? strutStyle,
  9. TextAlign textAlign = TextAlign.start,
  10. TextDirection textDirection = TextDirection.ltr,
  11. Locale? locale,
  12. double textScaleFactor = 1,
  13. TextWidthBasis textWidthBasis = TextWidthBasis.parent,
  14. bool expand = false,
  15. Alignment alignment = Alignment.topCenter,
  16. Key? key,
})

Auto control Collapse text to max lines. If the text's line < maxLines, then will show text directly

Implementation

ExpandableText.lines(this.text,
    {required this.lines,
    this.arrowColor,
    this.arrowSize = 24,
    this.arrowWidgetBuilder,
    this.animationDuration = const Duration(milliseconds: 150),
    this.textStyle,
    this.strutStyle,
    this.textAlign = TextAlign.start,
    this.textDirection = TextDirection.ltr,
    this.locale,
    this.textScaleFactor = 1,
    this.textWidthBasis = TextWidthBasis.parent,
    this.expand = false,
    this.alignment = Alignment.topCenter,
    Key? key})
    : vsync = null,
      expandMode = _ExpandMode.Lines,
      super(key: key);