validatePhoneNumber function

bool validatePhoneNumber(
  1. String phone
)

validatePhoneNumber checks if a number is either a Kenyan , American, UK or Belgium phone number

Implementation

bool validatePhoneNumber(String phone) {
  if (kenyanPhoneRegExp.hasMatch(phone) ||
      (americanPhoneRegExp.hasMatch(phone)) ||
      (unitedKingdomRegExp.hasMatch(phone)) ||
      (genericInternationalRegExp.hasMatch(phone))) {
    return true;
  } else {
    return false;
  }
}