CustomText constructor

const CustomText(
  1. String text, {
  2. Key? key,
  3. required List<Definition> definitions,
  4. ParserOptions parserOptions = const ParserOptions(),
  5. TextStyle? style,
  6. TextStyle? matchStyle,
  7. TextStyle? tapStyle,
  8. TextStyle? hoverStyle,
  9. void onTap(
    1. GestureDetails
    )?,
  10. void onLongPress(
    1. GestureDetails
    )?,
  11. void onGesture(
    1. GestureDetails
    )?,
  12. Duration? longPressDuration,
  13. bool preventBlocking = false,
  14. StrutStyle? strutStyle,
  15. TextAlign? textAlign,
  16. TextDirection? textDirection,
  17. Locale? locale,
  18. bool? softWrap,
  19. TextOverflow? overflow,
  20. double? textScaleFactor,
  21. int? maxLines,
  22. String? semanticsLabel,
  23. TextWidthBasis? textWidthBasis,
  24. TextHeightBehavior? textHeightBehavior,
})

Creates a text widget that decorates strings and enables tap, long-press and/or hover gestures based on flexible definitions.

This widget is useful for making partial strings in text such as URLs, email addresses or phone numbers clickable, or for only highlighting some parts of text with colors and different font settings depending on the types of text elements.

Implementation

const CustomText(
  this.text, {
  super.key,
  required this.definitions,
  this.parserOptions = const ParserOptions(),
  this.style,
  this.matchStyle,
  this.tapStyle,
  this.hoverStyle,
  this.onTap,
  this.onLongPress,
  this.onGesture,
  this.longPressDuration,
  this.preventBlocking = false,
  this.strutStyle,
  this.textAlign,
  this.textDirection,
  this.locale,
  this.softWrap,
  this.overflow,
  this.textScaleFactor,
  this.maxLines,
  this.semanticsLabel,
  this.textWidthBasis,
  this.textHeightBehavior,
});