Skip to content
pubscout

substring_highlight

1.0.33, released 6 years ago by onlyup.com

Highlight text at the character-level for simple search term highlighting.

WASM-ready
$ flutter pub add substring_highlight
Source repository

What it does

Provides a widget that highlights specific substrings or search terms within a longer text string. Supports case-insensitive matches, custom text styles for highlighted and non-highlighted portions, and basic overflow options.

AI-written summary of version 1.0.33, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to highlight search terms inside search results or lists
  • You want character-level or substring matching inside a Flutter Text widget

Skip it when

  • You need the highlighted text to be interactive or clickable
  • You require complex markdown or rich-text parsing beyond basic search term highlighting

Strengths

  • Simple and lightweight widget for search term highlighting
  • Supports customizable text styles for matches and non-matches
  • Supports multiple search terms and case-sensitive options

Weaknesses

  • Highlighted text is not clickable
  • Ancestor widget must have textDirection set explicitly or via MaterialApp

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

not documented

SubstringHighlight(
  text: dropDownItem,
  term: searchTerm,
  textStyle: TextStyle(color: Colors.grey),
  textStyleHighlight: TextStyle(color: Colors.black, decoration: TextDecoration.underline),
)

Alternatives

Packages that do the same job and could replace substring_highlight.

Works with

Packages commonly used together with substring_highlight: ones it builds on, ones built on it, and its own family.