createMention method

Future<void> createMention()

Implementation

Future<void> createMention() async {
  List<RegExpMatch> matches = FacetUtil.mentionReg.allMatches(text).toList();
  for (RegExpMatch match in matches) {
    String part = text.substring(match.start, match.end);
    int byteStart = len(match.start);
    int byteEnd = len(match.end);
    await addFacet({"\$type": facet}, part, byteStart, byteEnd, mention);
  }
}