TextField(
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(RegExp("[0-9]")),
], // Only numbers can be entered
keyboardType: TextInputType.numberWithOptions(decimal: true), // open decimal keyboard
),
References
https://stackoverflow.com/questions/50442372/restrict-special-character-input-flutter
Restrict Special Character Input Flutter
I have a TextField that will only take numbers as an input. The Keyboard that appears allows for the input of the the following characters: "-(hyphen) ,(comma) .(period) and space". How can I preve...
stackoverflow.com
How to limit user to enter more or less a particular value in TextField in Flutter?
I have a situation where I need to restrict users from entering a value greater than or less than a value (say x <int> type). Here is my input field TextField( decoration: InputDecoration( ...
stackoverflow.com
728x90
'Flutter' 카테고리의 다른 글
| [Flutter] 이미지 데이터 서버에 업로드하기 (0) | 2022.05.02 |
|---|---|
| [Flutter] list add to first (0) | 2022.04.28 |
| [Flutter] flutter close keyboard on textfield submit(close-hide-keyboard) (0) | 2022.04.28 |
| [Flutter] Textfield 속성 (0) | 2022.04.28 |
| [Flutter] flutter remove textfield underline (0) | 2022.04.28 |