equalTo<T> function
Returns a validator that checks this control's value equals
other's value. Useful for "confirm password" fields.
The comparison runs every time the current control is validated.
To also re-validate when other changes, call
other.addListener(() => thisControl.validate()).
Implementation
ValidatorFn<T> equalTo<T>(FormControl<T> other, {String? message}) {
return (value) {
if (value != other.value) {
return message ?? 'values must match';
}
return null;
};
}