Flutter TextFormField TextInputAction.done is not an option with keyboard type numbers

Issue

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?

Solution

Add this to your textFormField

keyboardType: TextInputType.numberWithOptions(signed: true),
inputFormatters: [
  FilteringTextInputFormatter.digitsOnly,
],

Answered By – Kaushik Chandru

Answer Checked By – Clifford M. (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.