Validates whether the input value is empty or not.
String? requiredValidator(String value) => value.trim().isEmpty ? 'This field is required.' : null;