isValid method

  1. @override
bool isValid(
  1. String text
)
override

Check current text is valid to parse or not

Implementation

@override
bool isValid(String text) {
  if (text.isEmpty) {
    return true;
  } else {
    try {
      numberFormat.parse(text);
      return true;
    } on FormatException {
      return false;
    }
  }
}