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!
You can use the
onChanged
property of text field by passing in a function that accepts the new text as a paramter. Try this: