Home > Back-end >  Separate color for a word in sentence which starts with "@"
Separate color for a word in sentence which starts with "@"

Time:07-24

In flutter how can we add separate color for a word in a sentence which starts with '@' with separate color when displaying that sentence to UI? Like in Instagram when we mention an user in comment section, the tagged user must be in different color

CodePudding user response:

You could use regex to find pattern from the string, I believe your question has been answered here.

CodePudding user response:

You can try to use RichText for this case.

  • Related