SubstringHighlight constructor

const SubstringHighlight({
  1. Key? key,
  2. bool caseSensitive = false,
  3. int? maxLines,
  4. TextOverflow overflow = TextOverflow.clip,
  5. String? term,
  6. List<String>? terms,
  7. required String text,
  8. TextAlign textAlign = TextAlign.left,
  9. TextStyle textStyle = const TextStyle(color: Colors.black),
  10. TextStyle textStyleHighlight = const TextStyle(color: Colors.red),
  11. String wordDelimiters = ' .,;?!<>[]~`@#\$%^&*()+-=|/_',
  12. bool words = false,
})

Creates a SubstringHighlight widget.

The text parameter is required and represents the text to be displayed. Either term or terms must be provided for highlighting.

Implementation

const SubstringHighlight({
  Key? key,
  this.caseSensitive = false,
  this.maxLines,
  this.overflow = TextOverflow.clip,
  this.term,
  this.terms,
  required this.text,
  this.textAlign = TextAlign.left,
  this.textStyle = const TextStyle(
    color: Colors.black,
  ),
  this.textStyleHighlight = const TextStyle(
    color: Colors.red,
  ),
  this.wordDelimiters = ' .,;?!<>[]~`@#\$%^&*()+-=|/_',
  this.words = false,
})  : assert(term != null || terms != null),
      super(key: key);