validateWithParent method

  1. @override
FutureOr<Result> validateWithParent(
  1. dynamic value,
  2. Map<String, dynamic> map, {
  3. bool exists = true,
})
override

Validates the value with access to the parent map. May be async.

Implementation

@override
FutureOr<Result> validateWithParent(dynamic value, Map<String, dynamic> map, {bool exists = true}) {
  final cond = condition.validator(map);
  if (cond is Future<Result>) {
    return cond.then((cr) => _evalBranch(cr, value));
  }
  return _evalBranch(cond, value);
}