isHighlightedWord function
bool
isHighlightedWord(
- List<
String> wordList, { - required int index,
- required WordHighlight wordHighlight,
Implementation
@protected
bool isHighlightedWord(List<String> wordList,
{required int index, required WordHighlight wordHighlight}) {
switch (wordHighlight.highlightType) {
case HighlightType.byIndex:
{
return index == wordHighlight.wordIndex;
}
case HighlightType.byWord:
{
return wordHighlight.ignoreCase
? wordList[index].toLowerCase() ==
wordHighlight.word?.toLowerCase()
: wordList[index] == wordHighlight.word;
}
default:
false;
}
return false;
}