I'm new to flutter and I'm trying to figure out a way so that users can type their pronouns in a very specific way into my app. They can type "she/her/hers" for example, and if they press space, a "/" would appear. I currently have a textfield for this but I'm not sure where to proceed and how it could work.
I have this in my code right now:
String _textSelect(String _controller) {
_controller = _controller.replaceAll(" ", "/");
return str;
}
But it doesn't work. Any help would be really appreciated. Thank you!
I would recommend using a TextInputFormatter for that.
Have a look at https://api.flutter.dev/flutter/services/TextInputFormatter-class.html
"To create custom formatters, extend the TextInputFormatter class and implement the formatEditUpdate method."