I wrote a package called flutter_taggable similar to the one OP mentioned in a comment on Craxiom's answer, which contains an extension to the TextEditingController to handle all tagging logic. The packages are quite similar, but I'd say flutter_taggable is a bit more customizable and does not have any dependencies. I wrote a small Medium article on how to use it and how one might send notifications to tagged users.
The behaviour of the package is quite similar to how WhatsApp handles user tagging, such as not allowing users to put the cursor inside of a tag. It can also handle tags such as @here
or @everyone
like on Discord, as well as inserting tags programmatically.