validationFromName function

ValidationRule? validationFromName(
  1. String name
)

Returns the provided ValidationRule with the given name, if any

Implementation

ValidationRule? validationFromName(String name) {
  if (name.isEmpty) return null;
  final _rule = name.endsWith('Rule') ? '' : 'Rule';
  final _name =
      '${name.substring(0, 1).toLowerCase()}${name.substring(1)}$_rule';
  return _allValidationRules[_name];
}