NumNode<T extends num> class

Fluent validator for num values (int/double).

Supports range, positivity, etc.

Example:

Checkit.num.min(1).max(10).validateOnce(5);
Inheritance

Constructors

NumNode(ValidationContext _context)

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}) NumNode<T>
inherited
build({ValidationContext? context}) ValidatorSet<T>
Finalizes the validator into a reusable set.
inherited
clone({ValidationContext? context}) NumNode<T>
Clones this node with an optional different context.
override
custom(bool validate(T value, ValidationContext context), {String error = ''}) NumNode<T>
Adds a custom validator using a function.
inherited
every(List<Validator<T>> validators, {String? error}) NumNode<T>
inherited
max(int max, {String? error, bool inclusive = true}) NumNode<T>
Sets the maximum allowed value (default: inclusive).
min(int min, {String? error, bool inclusive = true}) NumNode<T>
Sets the minimum allowed value (default: inclusive).
negative({String? error}) NumNode<T>
Requires the value to be negative (< 0).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
not(Validator<T> validator, {String? error}) NumNode<T>
Negates another validator.
inherited
positive({String? error}) NumNode<T>
Requires the value to be positive (> 0).
range(num min, num max, {String? error, bool includeMin = true, bool includeMax = true}) NumNode<T>
Validates that the number is within a specific range.
toString() String
A string representation of this object.
inherited
validateOnce(T? value, {bool? stopOnFirstError}) ValidationResult
Quick validation without manually building the set.
inherited
withContext(ValidationContext context) NumNode<T>
Shortcut to clone with updated context.
override

Operators

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