desconexo / highlight_text

A flutter plugin to highlight words from a text
MIT License
30 stars 22 forks source link

Not working with numbers #8

Closed fenchai23 closed 3 years ago

fenchai23 commented 4 years ago
String needle = '22020 toy 4x4 combo';

String haystack = '17801-22020 TOY RAV4 COMBO 4x4';

List<String> needleList = needle.split(' ');

Map<String, HighlightedWord> testWords = {
  for (var v in needleList)
    v: HighlightedWord(
        textStyle: TextStyle(color: Colors.red), onTap: () {})
};

the 22020 does not get highlighted sadly Is this a limitation? :(

edit: 17801-22020 (works), -22020 (does not work), rav (works), so this is more like a limitation of IF it contains numbers then it needs to match the entire word?

desconexo commented 3 years ago

Hi, I'm currently reworking this package and this problem it's not happening anymore. Soon i'll upload it