isValidPhoneNumber method
Checks the object is a String and is a valid phone number
Implementation
AbstractRuleBuilder isValidPhoneNumber({String? message}) {
return must(
(dynamic dyn) =>
dyn is String && CommonRegex.numberValidator.hasMatch(dyn),
message != null
? message
: useKeyAsElementName
? "$key must be a valid phone number"
: "String must be a valid phone number",
code: "notValidPhoneNumber");
}