Reputation: 21
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
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
Reputation: 1981
keyboardType: TextInputType.emailAddress,
TextFormField(
textInputAction: TextInputAction.next,
focusNode: secondFocusNode,
keyboardType: TextInputType.emailAddress,
controller: emailController,
),
Upvotes: 0