Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyboardType: TextInputType.number not working on iOS for cardNumber #126

Closed
baptistesx opened this issue Feb 1, 2023 · 4 comments · Fixed by #130
Closed

keyboardType: TextInputType.number not working on iOS for cardNumber #126

baptistesx opened this issue Feb 1, 2023 · 4 comments · Fixed by #130

Comments

@baptistesx
Copy link

Heyy!
I have no clue why keyboardType: TextInputType.number is not working on iOS for cardNumber. It is working as expected on android.
Here is a demo:

Enregistrement.de.l.ecran.2023-02-01.a.03.42.10.mov

I can see in the package code /flutter_credit_card-3.0.5/lib/credit_card_form.dart line 194, the keyboardType prop is well setup
image

Any idea?

@adamcastleman
Copy link

AutofillHints.creditCardNumber overrides and displays number + options. Delete the autofill hint variable entirely and the keyboard type will display just the numbers.

Use the hintText under the InputDecoration if you still need the hint.

@baptistesx
Copy link
Author

thanks @adamcastleman for your answer.

You mean remove it like this?
image

But it's in the packge, i cannot touch it, except if if copy it locally but then it won't be linked to pub anymore, that's not good. Or i miss something?

@adamcastleman
Copy link

Right - you could copy to a local file. The form is just a StatefulWidget. It would still interact with the card widget.

You do lose access to pub updates. This may not really be all bad for the form - how often does a form entering CC info need to radically change?

You could also file a pull request and change the hardcoded value to softcode and feed it into the widget.

Or hopefully, a package manager is seeing this and can submit a pull request themselves.

The number + options was just annoying enough for me to decide to copy over the form. It also let me clean it up. You'll have to decide for your own app.

@baptistesx
Copy link
Author

Thank you, it took me 45s! I hope one day, i'll have time to do a PR...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants