skip to Main Content

Is there any way I can set the default language for some text fields in my application to only use the keyboard of a certain language like English?

Thank you!

2

Answers


  1. Hello with in the MaterialApp you can specify the language like this

    MaterialApp(
          locale: Locale('en', 'US'),
          home: MyHomePage(),
        );
    

    Hope it will work

    Login or Signup to reply.
  2. Until you find a straightforward answer or a (Future Update)

    You can notify the user with a helper text ex: English Language only

    And restrict your input to be english characters only by using regular expression:

    TextField(
       inputFormatters: [
                FilteringTextInputFormatter.allow(RegExp("[a-zA-Z]"))
           ])
    

    Hope it helps you.

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