Designed for case-insensitive search-term highlighting, a single search term sub-string is highlighted (perhaps multiple times) within a longer string.
Inspired by the existing Flutter package "highlight_text" which supports word matches ('Peter''), but substring_highlight has more granular character-by-character matches (e.g., 't' in 'Peter').
Limitations:
Highlighted text is not clickable
Doesn't solve perplexing world problems like hunger and climate change
The substrings being searched for highlighting don't have to match at the beginning of the longer strings (can be anywhere inside).
Even space characters will match, but not be highlighted, obviously.
Ancestor MUST have textDirection set (required by internal RichText widget), either through MaterialApp widget or explicitly wrapped by a Directionality widget: