fix decimal in number only text field
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user