UkPlatePattern class Extensibility

Matches UK license plates in the current format (post-2001): two letters + two digits + three letters, with an optional space between the two groups (AB12 CDE or AB12CDE).

The mode field controls whether the separating space is required, forbidden, or optional.

V.string().licensePlate(
  patterns: [const UkPlatePattern(mode: ValidationMode.formatted)],
);

See also:

Inheritance

Constructors

UkPlatePattern({ValidationMode mode = ValidationMode.any})
Creates a UkPlatePattern.
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 is a valid license plate for this pattern.
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