NumMessage class
A message container for validation errors related to num values.
This class extends NumberMessage<num>, inheriting general validation messages
for numerical types while allowing customization for num-specific error messages.
Example
final numMessages = NumMessage(
min: (value) => 'The number must be at least $value',
max: (value) => 'The number must be at most $value',
);
- Inheritance
-
- Object
- BaseMessage
- NumberMessage<
num> - NumMessage
Constructors
- NumMessage({String? any, ArrayMessage? array, String between(num min, num max)?, String? every, String max(num max)?, String min(num min)?, String multipleOf(num multipleOf)?, String? negative, String? positive, String? refine, String? required})
-
Creates a new instance of
NumMessagewith customizable validation messages.
Properties
- any → String
-
The error message used when at least one of multiple validators must pass (
orcondition).finalinherited - array → ArrayMessage
-
The error message container for array-related validation errors.
finalinherited
- between → String Function(num min, num max)
-
Message for the validation that ensures a number is within a range.
finalinherited
- every → String
-
The error message used when all of multiple validators must pass (
andcondition).finalinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- max → String Function(num max)
-
Message for the maximum allowed value validation.
finalinherited
- min → String Function(num min)
-
Message for the minimum allowed value validation.
finalinherited
- multipleOf → String Function(num multipleOf)
-
Message for the "multiple of" validation.
finalinherited
- negative → String
-
Message for the validation that ensures a number is negative.
finalinherited
- positive → String
-
Message for the validation that ensures a number is positive.
finalinherited
- refine → String
-
The error message used when a custom refinement validation fails.
finalinherited
- required → String
-
The error message used when a required value is missing.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{String? any, ArrayMessage? array, String between(num min, num max)?, String? every, String max(num max)?, String min(num min)?, String multipleOf(num multipleOf)?, String? negative, String? positive, String? refine, String? required}) → NumMessage -
Creates a copy of the current
NumMessageinstance with updated values.override -
mergeWithBase(
BaseMessage base) → NumMessage -
Merges the current
NumMessageinstance with aBaseMessage, replacing only the undefined values with those from the base. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited