Numeric class

The Numeric Rule.

Validates that the field is a num or a numeric string. Mirrors Laravel's numeric rule (is_numeric).

Usage

validate(data, {
  'price': [Required(), Numeric()],
});
Inheritance

Constructors

Numeric()
Creates a Numeric rule. Const, because it carries no state.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
name → String
The short name this rule is known by in a messages override map.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

message() → String
Get the validation error message.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
params() → Map<String, dynamic>
Get the replacement parameters for the message.
inherited
passes(String attribute, dynamic value, Map<String, dynamic> data) → bool
Determine if the validation rule passes.
override
toString() → String
A string representation of this object.
inherited

Operators

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