Validation function that returns an error message if input is invalid.
typedef ValidateFunc = String? Function(String value);