Installing
- See the official installing guideline from highlightable/install
Usage
Very basic usage:
HighlightText(
'Only numbers: [10, 25, 50, ...] will be highlighted',
// would highlight only numbers.
highlight: Highlight(pattern: r'\d'),
)
![Screen Shot 2022-03-20 at 18 12 28](https://user-images.githubusercontent.com/59066341/159167993-31854ab2-011f-4138-97ae-9c83fc202181.png)
Custom usage:
HighlightText(
"Hello, Flutter!",
// Would highlight only "Flutter"
// full word 'cause [detectWords] is enabled.
highlight: Highlight(
words: ["Flutter"],
),
caseSensitive: true, // Turn on case-sensitive.
detectWords: true,
style: TextStyle(
fontSize: 25,
color: Colors.black,
fontWeight: FontWeight.bold,
),
highlightStyle: TextStyle(
fontSize: 25,
letterSpacing: 2.5,
color: Colors.white,
backgroundColor: Colors.blue,
fontWeight: FontWeight.bold,
),
)
![Screen Shot 2022-03-20 at 18 47 16](https://user-images.githubusercontent.com/59066341/159168147-a565e5a6-fcad-4f44-908b-e472ce1517f9.png)