validate static method
Validates the value against a list of rules.
Returns the first error message found, or null if all rules pass.
Implementation
static String? validate(String? value, List<ValidationRule> rules) {
for (final rule in rules) {
final error = rule(value);
if (error != null) return error;
}
return null;
}