bhrott / flutter-masked-text

A masked text for Flutter.
https://pub.dartlang.org/packages/flutter_masked_text
MIT License
276 stars 124 forks source link

MoneyMask force 0,000 (three 0 on decimal) #62

Open guihsdev opened 4 years ago

guihsdev commented 4 years ago

image

I will follow the order of the print numbering.

  1. MoneyMaskTextController declaration, in BRL format without "R$".
  2. What I typed in the Field
  3. What is printing on onChange
  4. Result of conversion from BRL to Double (to make an operation in the API)
guihsdev commented 4 years ago

For more examples: image image After I hit 0 once image

Nothing changes visually, but if I press "," or "." the value is entered, just is not displayed. image

WallysonRodrigues commented 3 years ago

To solve it in my case, I decided to use the controller.text instead of the value returned by the onChanged method.

 onChanged: (value) {
           print (value);
           print (controller.text);
         },