'TextInputType.number only accepts numbers from an english keyboard

i am making a multilingual shopping app and i have arabic and anthor language ++ english as the languages the user can pick, when someone wants to order they have to fill a form where it asks for their phone number and they can type it in a textfield, however if their keyboard is already on arabic or another language and they press numbers nothing shows in the text field, anybody knows how i can fix that?

i've tested it both on simu and real iphone 11 device.



Solution 1:[1]

Insert this code snippet into the TextFormField

inputFormatters: <TextInputFormatter>[
              FilteringTextInputFormatter.allow(RegExp('[0-9?-?]')),
            ],

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MoeinGL