yusong hu
yusong hu

Reputation: 21

how to make can a TextField content's type can be number and letter if obscureText property is true

using a TextField and its obscureText property is true, how can I input some letter, now only the number can be input

obscureText:true,
textInputFormatter: WhitelistingTextInputFormatter(RegExp("[a-zA-Z0-9]"))

I want to make the TextField's input can be both letters and numbers

Upvotes: 0

Views: 62

Answers (2)

viskanic
viskanic

Reputation: 36

The obscureText property should not matter.

If you want to input letters and numbers, then you have to use the keyboardType property.

For example:

keyboardType: TextInputType.text

BR

Upvotes: 1

Vithani Ravi
Vithani Ravi

Reputation: 1981

keyboardType: TextInputType.emailAddress,

TextFormField(
            textInputAction: TextInputAction.next,
            focusNode: secondFocusNode,
            keyboardType: TextInputType.emailAddress,
            controller: emailController,

          ),

Upvotes: 0

Related Questions