FormRules class
A small fluent helper to build validation rules for controls inside a FormGroup, with support for cross-field dependencies.
Why this exists:
dart_ng_formsallows attaching a single validator to a control.- In real forms, you often need to compose multiple validators and also re-validate a field when other fields change (cross-field rules).
Example:
final rules = FormRules(form);
rules.ruleFor<String>('password')
.compose(notEmpty)
.compose(minLength8)
.dependsOn('username'); // re-validates password when username changes
// later...
rules.dispose();
Properties
Methods
-
dispose(
) → void - Detaches all listeners registered through this instance.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
ruleFor<
T> (String fieldName) → RuleFor< T> -
Creates a fluent rule builder for the given
fieldName. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited