Skip to content

Commit

Permalink
InputNumber: fix zero decimal currencies, fix #57
Browse files Browse the repository at this point in the history
  • Loading branch information
dreautall committed Jun 10, 2023
1 parent be09db4 commit c7d677f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/widgets/input_number.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class NumberInput extends StatelessWidget {

@override
Widget build(BuildContext context) {
debugPrint(
"Building with initialValue $value, decimals $decimals, hintText $hintText");
return TextFormField(
controller: controller,
initialValue: value,
Expand Down Expand Up @@ -66,5 +68,5 @@ class NumberInput extends StatelessWidget {

String _getRegexString() => (decimals > 0)
? r'^[0-9]+[,.]{0,1}[0-9]{0,' + decimals.toString() + r'}'
: r'^[0-9]$';
: r'[0-9]';
}

0 comments on commit c7d677f

Please sign in to comment.