RuleFor<T> class

Fluent rule builder for a single control inside a FormGroup.

It supports:

  • composing multiple validators into one (first error wins)
  • attaching cross-field dependencies (revalidate when other controls change)

Properties

fieldName String
The target field name to which the composed validator will be attached.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compose(FormFieldValidator<T> validator) RuleFor<T>
Adds a single validator to this rule chain.
composeAll(Iterable<FormFieldValidator<T>> validators) RuleFor<T>
Adds multiple validators to this rule chain.
dependsOn(String anotherFieldName) RuleFor<T>
Declares that this rule depends on another control identified by anotherFieldName.
dependsOnAll(Iterable<String> fieldNames) RuleFor<T>
Declares multiple dependencies at once.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited