alphabetic static method
Validates alphabetic characters only
Example:
Validators.alphabetic('abc');
Implementation
static String? alphabetic(String? value, {String? message}) {
if (value == null || value.isEmpty) return null;
final regex = RegExp(r'^[a-zA-Z]+$');
if (!regex.hasMatch(value)) {
return message ?? 'Only alphabetic characters are allowed';
}
return null;
}