ReadMoreText constructor
- String data, {
- Key? key,
- String trimExpandedText = ' read less',
- String trimCollapsedText = ' ...read more',
- Color? colorClickableText,
- int trimLength = 240,
- int trimLines = 2,
- TrimMode trimMode = TrimMode.length,
- TextStyle? style,
- TextAlign? textAlign,
- TextDirection? textDirection,
- Locale? locale,
- TextScaler? textScaleFactor,
- 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,
});