required static method
Validates that the field is not empty.
Implementation
static String? required(String? value, {String fieldName = 'This field'}) {
if (value == null || value.trim().isEmpty) {
return '$fieldName is required';
}
return null;
}