getTextWithMentions static method

String getTextWithMentions(
  1. String text,
  2. List<User> mentionedUsers
)

Implementation

static String getTextWithMentions(String text, List<User> mentionedUsers) {
  if (mentionedUsers.isNotEmpty) {
    for (var user in mentionedUsers) {
      text = text.replaceAll("<@uid:${user.uid}>", "@${user.name}");
    }
  }
  return text;
}