bhrott / flutter-masked-text

A masked text for Flutter.

Home Page:https://pub.dartlang.org/packages/flutter_masked_text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid double in numberValue when delete value in TextFormField

hassanbht opened this issue · comments

Hello,
I'm getting this error in my MoneyMaskedTextController when clear TextFormField
error : Type (FormatException) "Invalid double"

double get numberValue {
List parts = _getOnlyNumbers(this.text).split('').toList(growable: true);
parts.insert(parts.length - precision, '.'); // value : "."
return double.parse(parts.join());
}

commented

Hi, @hassanbht

How do you solve this problem >?

I'm getting this error when calling clear() on MoneyMaskedTextController:

The following RangeError was thrown while dispatching notifications for MoneyMaskedTextController:
Invalid value: Only valid value is 0: -2

Were you able to solve this problem?