IpNode<T extends String> class

Validates that a string represents a valid IP address.

Supports v4/v6, local, range, and subnet checks.

Example:

Checkit.string.ip().v4().validateOnce('192.168.1.1');
Inheritance

Constructors

IpNode(ValidationContext _config)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

any(List<Validator<T>> validators, {String? error}) IpNode<T>
inherited
build({ValidationContext? context}) ValidatorSet<T>
Finalizes the validator into a reusable set.
inherited
clone({ValidationContext? context}) IpNode<T>
Clones this node with an optional different context.
override
custom(bool validate(T value, ValidationContext context), {String error = ''}) IpNode<T>
Adds a custom validator using a function.
inherited
every(List<Validator<T>> validators, {String? error}) IpNode<T>
inherited
inSubnet(String cidr, {String? error}) IpNode<T>
Requires the IP to be within a specific CIDR subnet (e.g. 192.168.1.0/24).
linkLocal({String? error}) IpNode<T>
Requires the IP to be link-local (e.g. 169.254.x.x or fe80::/10).
localhost({String? error}) IpNode<T>
Requires the IP to represent localhost (127.0.0.1 for IPv4 or ::1 for IPv6).
loopback({String? error}) IpNode<T>
Requires the IP to be within the loopback range (127.0.0.0/8 or ::1).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
not(Validator<T> validator, {String? error}) IpNode<T>
Negates another validator.
inherited
range(String startIp, String endIp, {String? error}) IpNode<T>
Requires the IP to be within a specified range from startIp to endIp (inclusive).
toString() String
A string representation of this object.
inherited
v4({String? error}) IpNode<T>
Requires the value to be a valid IPv4 address (e.g. 192.168.1.1).
v6({String? error}) IpNode<T>
Requires the value to be a valid IPv6 address.
validateOnce(T? value, {bool? stopOnFirstError}) ValidationResult
Quick validation without manually building the set.
inherited
withContext(ValidationContext context) IpNode<T>
Shortcut to clone with updated context.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited