not<T> static method

Validator<T> not<T>(
  1. Validator<T> validator, {
  2. String? error,
})

Implementation

static Validator<T> not<T>(Validator<T> validator, {String? error}) => (
      value,
      context,
    ) {
      if (validator(value, context).$1 == false) return (true, null);
      return (
        false,
        error ??
            'The validation succeeded for value "$value", but it was expected to fail.',
      );
    };