phone static method
Phone number validator (basic).
Implementation
static String? phone(String? string, {String? errorMessage}) {
final phoneRegExp = RegExp(r'^\+?[0-9]{7,15}$');
if (string == null || string.isEmpty || phoneRegExp.hasMatch(string)) {
return null;
}
return errorMessage ?? FieldBlocValidatorsErrors.phone;
}