getRule method

List<FormifyRule> getRule(
  1. String attribute
)

Get the validation rules for a form attribute.

The getRule function is used to retrieve the validation rules associated with a specific form attribute based on its identifier. It looks up the attribute in the rules map and returns its associated list of FormifyRule objects. If the attribute is not found, it defaults to an empty list [].

Parameters:

  • attribute: The identifier of the form attribute for which you want to retrieve the validation rules.

Implementation

List<FormifyRule> getRule(String attribute) {
  return rules[attribute] ?? [];
}