Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Empty field triggers errors on MoneyMaskedTextController #69

@thiagocordeiro

Description

@thiagocordeiro

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions