greenzebra
greenzebra

Reputation: 577

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?

Upvotes: 5

Views: 2179

Answers (2)

daivph
daivph

Reputation: 83

iOS doesn’t support Done on keyboards, Use

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

Upvotes: 3

Kaushik Chandru
Kaushik Chandru

Reputation: 17792

Add this to your textFormField

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

Upvotes: 8

Related Questions