text_with_highlight 1.0.0 text_with_highlight: ^1.0.0 copied to clipboard
Super lightweight widget that adds a rich text containing highlighted words/sentences.
A simple and lightweight RichText widget to write a text with highlighted words
Features #
This package is helpful for people who needs to have one or more highlighted words in their text.
Basic Title example: [Example]
Features:
- You can specify the styles of the normal and highlighted parts
- You can have multiple highlighted words or phrases in one single Text
- Easy to customize
Getting started #
To use this plugin, add spinner
as a dependency in your pubspec.yaml file.
Usage #
Example to have IMPORTANT:
, HOME
and COMPILE
in bold and red color and the rest of the text in normal style:
const TextWithHighlight(
text: 'IMPORTANT: take your test at HOME and COMPILE it',
highlightedTexts: ['IMPORTANT:', 'HOME', 'COMPILE'],
textStyle: TextStyle(
fontWeight: FontWeight.normal,
fontSize: 28,
color: Colors.black,
)),
highlightedTextStyle = TextStyle(
fontWeight: FontWeight.bold,
fontSize: 28,
color: Colors.red,
),