skip to Main Content

I am developing a language app and my question is related to this. In this app, I can show the words from the local database that contain foreign characters in the app. Yet, when the users want to add a new word in a foreign language, the app does not recognize the foreign characters.

How can I make users add Turkish characters (or any other characters than English) in TextField in flutter? I am pretty new to developing apps. Any helpful answers would be really appreciated. I really thank you in advance for any help you can provide.

2

Answers


  1. To allow users to input Turkish characters or anyother character in Flutter, you will need to configure the TextField’s inputFormatters property.

    Use this code, it might help you:

    TextField(
      inputFormatters: [
        WhitelistingTextInputFormatter(RegExp("[a-zA-ZığüşöçİĞÜŞÖÇ ]"))
      ],
    )
    

    It has the regex for Turkish and you can tweak this accordingly.

    Login or Signup to reply.
  2. You don’t need to recognize for the language in TextField, Because the TextField can have any data in any language, You just have to change your own keyboard language to the language you want and you can start typing into that language like any other language.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search