CaPostalCodePattern class

Matches Canadian postal codes (A1A 1A1 — space optional).

The mode field controls whether the space between the forward sortation area and local delivery unit is required, forbidden, or optional.

V.string().postalCode(
  patterns: [const CaPostalCodePattern(mode: ValidationMode.formatted)],
);
Inheritance

Constructors

CaPostalCodePattern({ValidationMode mode = ValidationMode.any})
Creates a CaPostalCodePattern.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
mode ValidationMode
Controls whether the separating space is required, forbidden, or optional. Defaults to ValidationMode.any.
final
name String
Human-readable name used in error messages and debugging.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

matches(String value) bool
Returns true if value matches this pattern's format.
override
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