PhoneNumberValid class
Validator for validating a PhoneNumber input value.
Provides customizable error messages for invalid and empty phone numbers, and can be used with the form validation system to ensure that user input meets the required phone number format and completeness criteria.
- Inheritance
-
- Object
- Validator<
PhoneNumber> - PhoneNumberValid
Constructors
- PhoneNumberValid({String? invalidMessage, String? emptyMessage})
-
Creates a PhoneNumberValid validator with optional custom error messages.
const
Properties
- emptyMessage → String?
-
Custom error message for empty phone number input.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- invalidMessage → String?
-
Custom error message for invalid phone numbers.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
combine(
Validator< PhoneNumber> other) → Validator<PhoneNumber> -
Combines this validator with another validator using AND logic.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldRevalidate(
FormKey source) → bool -
Determines if this validator should be re-run when the specified form key changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validate(
BuildContext context, PhoneNumber? value, FormValidationMode lifecycle) → FutureOr< ValidationResult?> -
Validates the given
valueand returns a validation result.override
Operators
-
operator &(
Validator< PhoneNumber> other) → Validator<PhoneNumber> -
Combines this validator with another using AND logic (alias for combine).
inherited
-
operator +(
Validator< PhoneNumber> other) → Validator<PhoneNumber> -
Combines this validator with another using AND logic (alias for combine).
inherited
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator unary-(
) → Validator< PhoneNumber> -
Negates this validator's result (alias for
~operator).inherited -
operator |(
Validator< PhoneNumber> other) → Validator<PhoneNumber> -
Combines this validator with another using OR logic.
inherited
-
operator ~(
) → Validator< PhoneNumber> -
Negates this validator's result.
inherited