Flutter app keyboardType: shows different keyboard inputs on simulator/real device

482 views Asked by At

When i set keyboardType: TextInputType.numberWithOptions(decimal: true), my flutter app shows a comma in real device instead to show the point as in the simulator. The aim is to show the point so the app can run some calculation, that otherwise it would not do with a comma.

See pic below

enter image description here

1

There are 1 answers

10
Kaushik Chandru On BEST ANSWER

Probably you added locale in your project. Open the xcworkspace file on Xcode, select project runner and in info select locales under localisations. Check here if any other locale is added other en_US

Or when using the value from TextEditingController you can replace all comma with a period.

Like

double newVal = double.tryParse(_textController.text.replaceAll(",","."))??0.0;