isPhone method

bool isPhone()

Implementation

bool isPhone() {
  String pattern =
      r'^(?:\(?)(\d{3})(?:[\).\s]?)(\d{3})(?:[-\.\s]?)(\d{4})(?!\d)$';
  RegExp regExp = RegExp(pattern);
  return regExp.hasMatch(this);
}