isValid method

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

Implementation

@override
bool isValid(String value) {
  String v = strip(value);

  /// phone must have 10 or 11 chars
  if (v.length < 8 || v.length > 9) {
    return false;
  }

  /// Números de 9 dígitos sempre iniciam com 9.
  return !(v.length == 9 && v[0] != '9');
}