highlight_text
1.8.0, released 2 years ago by feer.dev
A Flutter widget to highlight specific words in text with custom styles and actions.
What it does
Allows developers to supply a dictionary of words to highlight inside a text string. Each highlighted word can have its own text style, padding, box decoration, and tap action.
AI-written summary of version 1.8.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to highlight specific keywords or search terms within a body of text.
- You want interactive words inside a text paragraph that trigger custom actions or callbacks when tapped.
Skip it when
- You need complex rich text formatting that goes beyond simple word highlighting and custom spans.
Strengths
- Supports custom tap actions, text styles, padding, and decorations for individual words.
- Handles case-sensitivity matching options and prevents subword highlighting issues.
Weaknesses
- Limited to string-based word matching dictionary models.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Map<String, HighlightedWord> words = {
"Flutter": HighlightedWord(
onTap: () {},
textStyle: TextStyle(color: Colors.blue),
),
};
TextHighlight(
text: "Learn Flutter today",
words: words,
)Alternatives
Packages that do the same job and could replace highlight_text.
- shimmer
Paints a moving highlight over skeleton placeholders and call-to-action text.
83Compare - flutter_markdown_plus
A Markdown renderer widget for Flutter to display rich text from plain text data.
77Compare - flutter_popup
A versatile Flutter package for creating customizable popups with highlight features.
75Compare - flutter_decorated_text
A widget to style and interact with parts of a text string based on predefined rules.
56Compare