You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using this package I found a weird behavior when returning a hashtag from the onTap
HashTagText(
text: userText, // Ex: This is my first time using a #hashtag
onTap: (hashtag) => Search.value(hashtag),
overflow: TextOverflow.ellipsis,
maxLines: 3,
),
If I tap on the hashtag I retrieve " #hashtag" with an empty space at the beggining (this doesn't happen if it's the first word).
If I use the method extractHashTags(userText) I get a list with the hashtags trimmed (I read the code at the end you use trim with every value). This gives some weird behavior when trying to save the list from extractHashTags and then finding the value selected by the onTap because the empty space at the beggining (using equality or saving the hashtags in a SQL or NoSQL db), I know I could do it myself onTap: (hashtag) => Search.value(hashtag.trim()) but it would be better for the package to return the same type in every method, which I believe doing the trimming could be a time saver to avoid different results
The text was updated successfully, but these errors were encountered:
@EdwynZN
Thank you for creating the issue.
Let me make it clear before I fix the problem. You mean the argument of onTap(hashtag) has unnecessary space and you think it should be trimmed, right? (If so, I agree.)
While using this package I found a weird behavior when returning a hashtag from the onTap
If I tap on the hashtag I retrieve " #hashtag" with an empty space at the beggining (this doesn't happen if it's the first word).
If I use the method
extractHashTags(userText)
I get a list with the hashtags trimmed (I read the code at the end you use trim with every value). This gives some weird behavior when trying to save the list fromextractHashTags
and then finding the value selected by the onTap because the empty space at the beggining (using equality or saving the hashtags in a SQL or NoSQL db), I know I could do it myselfonTap: (hashtag) => Search.value(hashtag.trim())
but it would be better for the package to return the same type in every method, which I believe doing the trimming could be a time saver to avoid different resultsThe text was updated successfully, but these errors were encountered: