StyledText constructor

const StyledText(
  1. String text,
  2. TextStyle style, {
  3. Key? key,
  4. TextAlign? align,
  5. int? maxLines,
  6. TextOverflow? overflow,
  7. TextDirection? textDirection,
  8. Locale? locale,
  9. bool? softWrap,
  10. StrutStyle? strutStyle,
})

Creates a StyledText widget.

text is the string to display. style is the text style to apply. Optional parameters allow further customization:

  • align sets the text alignment.
  • maxLines limits the number of lines.
  • overflow determines how overflowed text is displayed.
  • textDirection sets the text reading direction.
  • locale sets the locale for formatting.
  • softWrap indicates whether text should wrap at soft line breaks.
  • strutStyle provides strut style for vertical spacing.

Implementation

const StyledText(
  this.text,
  this.style, {
  super.key,
  this.align,
  this.maxLines,
  this.overflow,
  this.textDirection,
  this.locale,
  this.softWrap,
  this.strutStyle,
});