How to use InputFormatter on Flutter TextField?

后端 未结 4 1555
梦谈多话
梦谈多话 2020-12-03 05:00

What do I need to insert into TextField(inputFormatters:?

I want to disallow \\ and / in one TextField and only allow

4条回答
  •  盖世英雄少女心
    2020-12-03 05:41

    Other options:

    • lowercase letters : a-z

    • capital letters : A-Z

    • lowercase vowels accented : á-ú

    • capital vowels accented : Á-Ú

    • numbers : 0-9
    • space : (a space)

    Note: the spacings are to explain better

    inputFormatters: [
            WhitelistingTextInputFormatter(RegExp("[a-z A-Z á-ú Á-Ú 0-9]"))
          ]
    

提交回复
热议问题