ip static method

Validator<String> ip({
  1. String? error,
})

Implementation

static Validator<String> ip({String? error}) => (value, context) {
      final ip = context.resources.getOrCreate(
        value,
        () => IpResource.fromString(value),
        temp: !context.usePermanentCache,
      );

      if (ip != null) {
        return (true, null);
      }
      return (false, error ?? context.errors.ipErrors.ip(value));
    };