validate method
void
validate(
- String? path,
- Schema schema,
- dynamic value,
- List<
ValidationResult> results,
override
Validates a given value against this rule.
path
a dot notation path to the value.schema
a schema this rule is called fromvalue
a value to be validated.results
a list with validation results to add new results.
Implementation
@override
void validate(String? path, Schema schema, dynamic value,
List<ValidationResult> results) {
if (_rule == null) return;
var name = path ?? 'value';
var localResults = <ValidationResult>[];
_rule!.validate(path, schema, value, localResults);
if (localResults.isNotEmpty) return;
results.add(ValidationResult(path, ValidationResultType.Error, 'NOT_FAILED',
'Negative check for ' + name + ' failed', null, null));
}