validatePhone static method

bool validatePhone(
  1. String phone
)

Implementation

static bool validatePhone(String phone) {
  String pattern = r'^(?:[+0]84)?[0-9]{9,}$';
  RegExp regex = RegExp(pattern);

  return regex.hasMatch(phone);
}