SearchableText constructor

const SearchableText(
  1. String text, {
  2. Key? key,
  3. required String searchTerm,
  4. TextStyle? style,
  5. TextStyle? highlightedTextStyle,
  6. BoxDecoration? highlighterDecoration,
})

Creates a text widget with highlighted search terms.

The text parameter is the original text to be displayed.

The searchTerm parameter is the term to search for and highlight.

The style parameter defines the style for non-highlighted text.

The highlightedTextStyle parameter defines the style for highlighted text.

The highlighterDecoration parameter defines decoration for the highlighted area.

Implementation

const SearchableText(
  this.text, {
  super.key,
  required this.searchTerm,
  this.style,
  this.highlightedTextStyle,
  this.highlighterDecoration,
});