custom static method

Validator custom(
  1. bool valid,
  2. String message
)

Implementation

static Validator custom(bool valid, String message) {
  return (String? value) {
    return (!valid) ? message : null;
  };
}