Yes, it is possible to type in a decimal separator using both KeyboardType.Number and KeyboardType.Decimal in TextField.
When using KeyboardType.Decimal, the keyboard will show a decimal separator button. However, when using KeyboardType.Number, you can still type in a decimal separator by pressing the period (.) or comma (,) key depending on your device's regional settings.
For example, on a US keyboard, you would type a decimal separator using the period key. On a European keyboard, you would use the comma key.
You can also customize the decimal separator by setting the localization of the app to match the user's regional settings using the following code:
Locale.current.decimalSeparator
This will return the decimal separator character for the user's current locale.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2021-07-24 11:00:00 +0000
Seen: 12 times
Last updated: May 19 '21
How can TextField(value:format:prompt:) be set back to the initial prompt text?
Is the Flutter TextField causing a rebuild every time I click on it or remove the selection from it?
How do I adjust the height of a TextField in Jetpack Compose?
How can JSON be decoded while using a universal interface as a field?
How can a new object with a specific type be created in Angular 2 using the domain model?
What is a more effective method to verify the type of an Array containing elements of any type?
How can I remove items from the Symfony dropdown form type?
How can I create a new table by changing the current table type?