fix decimal in number only text field
This commit is contained in:
parent
73ff46faa7
commit
55fd214e03
1 changed files with 6 additions and 2 deletions
|
|
@ -166,10 +166,14 @@ class _MihTextFormFieldState extends State<MihTextFormField> {
|
||||||
maxLines: widget.passwordMode == true ? 1 : null,
|
maxLines: widget.passwordMode == true ? 1 : null,
|
||||||
readOnly: widget.readOnly ?? false,
|
readOnly: widget.readOnly ?? false,
|
||||||
keyboardType: widget.numberMode == true
|
keyboardType: widget.numberMode == true
|
||||||
? TextInputType.number
|
? const TextInputType.numberWithOptions(
|
||||||
|
decimal: true)
|
||||||
: null,
|
: null,
|
||||||
inputFormatters: widget.numberMode == true
|
inputFormatters: widget.numberMode == true
|
||||||
? [FilteringTextInputFormatter.digitsOnly]
|
? [
|
||||||
|
FilteringTextInputFormatter.allow(
|
||||||
|
RegExp(r'^\d*\.?\d*'))
|
||||||
|
]
|
||||||
: null,
|
: null,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: widget.inputColor,
|
color: widget.inputColor,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue