notSameAsValidator function

ValidatorType notSameAsValidator(
  1. String getValue(
      ),
    1. {String message = 'Values must not match.',
    2. ValidatorType onSuccess}
    )

    A validator which will return message if value is the same as the result of calling getValue.

    Implementation

    ValidatorType notSameAsValidator(String Function() getValue, {String message = 'Values must not match.', ValidatorType onSuccess}) {
      return (String name, Map<String, String> values, String value) {
        if (value == getValue()) {
          return message;
        } else if (onSuccess == null) {
          return null;
        } else {
          return onSuccess(name, values, value);
        }
      };
    }