withRule method

Schema withRule(
  1. IValidationRule rule
)

Adds validation rule to this schema.

This method returns reference to this exception to implement Builder pattern to chain additional calls.

  • rule a validation rule to be added. Returns this validation schema.

Implementation

Schema withRule(IValidationRule rule) {
  _rules ??= <IValidationRule>[];
  _rules!.add(rule);
  return this;
}