ReadMoreText constructor

const ReadMoreText(
  1. String data, {
  2. Key? key,
  3. String trimExpandedText = ' read less',
  4. String trimCollapsedText = ' ...read more',
  5. Color? colorClickableText,
  6. int trimLength = 240,
  7. int trimLines = 2,
  8. TrimMode trimMode = TrimMode.length,
  9. TextStyle? style,
  10. TextAlign? textAlign,
  11. TextDirection? textDirection,
  12. Locale? locale,
  13. TextScaler? textScaleFactor,
  14. String? semanticsLabel,
})

Creates a ReadMoreText widget.

The data parameter is the text to be displayed.

The trimExpandedText parameter is the text to be displayed for "read less" link.

The trimCollapsedText parameter is the text to be displayed for "read more" link.

The colorClickableText parameter is the color of the clickable text (read more/read less).

The trimLength parameter is the maximum length of the trimmed text.

The trimLines parameter is the maximum number of lines to display before trimming.

The trimMode parameter determines whether to trim by length or by lines.

The style parameter is the text style to apply.

The textAlign parameter is the alignment of the text within its container.

The textDirection parameter is the text direction to use.

The locale parameter is the locale used to select region-specific data.

The textScaleFactor parameter specifies the amount to scale the text.

The semanticsLabel parameter specifies a label for screen readers.

Implementation

const ReadMoreText(
  this.data, {
  super.key,
  this.trimExpandedText = ' read less',
  this.trimCollapsedText = ' ...read more',
  this.colorClickableText,
  this.trimLength = 240,
  this.trimLines = 2,
  this.trimMode = TrimMode.length,
  this.style,
  this.textAlign,
  this.textDirection,
  this.locale,
  this.textScaleFactor,
  this.semanticsLabel,
});