desconexo / highlight_text

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

refactor build span logic #45

Closed crizant closed 1 year ago

crizant commented 1 year ago

This is a refactor of the current build span logic. If this is merged, the next step will be rewriting the _bind() method. My goal is by making the _bind() method returns a List of String and int values, then we can tell if it's an int, it is a word that should be highlighted. No more int.tryParse() in the _buildSpan() method, so that users can pass any text into this plugin, including the | character and numbers.

But I might not be smart enough to fully understand the original implementation, so you may want to check it carefully.

desconexo commented 1 year ago

Can't check you PR right now. I'll do it soon. Thank you