substring_highlight
1.0.33, released 6 years ago by onlyup.com
Highlight text at the character-level for simple search term highlighting.
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.
- re_highlight
Powerful text syntax highlighting library translated from highlightjs.
50Compare - flutter_link_previewer
Customizable Flutter widget to fetch and render URL link previews.
91Compare - re_editor
A lightweight text and code editor widget for Flutter with syntax highlighting and folding.
80Compare - find_in_page
An in-app find bar that highlights and scrolls to text matches, including lazy-list rows.
71Compare
Works with
Packages commonly used together with substring_highlight: ones it builds on, ones built on it, and its own family.