I have a form with a Column of TextFormFields. My issue is that when I give a TextFormField a keyboardType: TextInputType.number
and textInputAction: TextInputAction.done
the textInputAction doesn't show up. This is not an issue for me with other keyboard types...
My question is: How do I create a TextFormField that has a keyboard with only numbers And have a textInputAction?
CodePudding user response:
iOS doesn’t support Done on keyboards, Use
TextFormField(
keyboardType: const TextInputType.numberWithOptions(
signed: true,
),
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
],
),
CodePudding user response:
Add this to your textFormField
keyboardType: TextInputType.numberWithOptions(signed: true),
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
],