Search code examples
flutterflutter-layout

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


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,
    ],