checkIfTrackerPlacedCausesDuplication method
void
checkIfTrackerPlacedCausesDuplication(
- int start,
- TextEditingController textEditingController
Implementation
void checkIfTrackerPlacedCausesDuplication(
int start, TextEditingController textEditingController) {
if (mentionedUsersMap.isNotEmpty) {
mentionedUsersMap.forEach((key, value) {
var matches = RegExp(key).allMatches(textEditingController.text);
if (matches.length > value.length) {
for (int i = 0; i < matches.length; i++) {
if (matches.elementAt(i).start == start) {
mentionedUsersMap[key]!.insert(i, null);
conflictingIndex = i;
break;
}
}
}
});
}
}