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

Empty field triggers errors on MoneyMaskedTextController

thiagocordeiro opened this issue · comments

When the user selects the text and deletes it, flutter triggers the following error:

======== Exception caught by foundation library ====================================================
The following RangeError was thrown while dispatching notifications for MoneyMaskedTextController:
Invalid value: Only valid value is 0: -2

When the exception was thrown, this was the stack: 
#0      List.insert (dart:core-patch/growable_array.dart:11:7)
#1      MoneyMaskedTextController.numberValue (package:flutter_masked_text/flutter_masked_text.dart:189:11)
#2      new MoneyMaskedTextController.<anonymous closure> (package:flutter_masked_text/flutter_masked_text.dart:140:29)
#3      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:243:25)
#4      ValueNotifier.value= (package:flutter/src/foundation/change_notifier.dart:309:5)