CnhPattern class Patterns
Valida CNHs brasileiras (Carteira Nacional de Habilitação — 11 dígitos).
Implementa o algoritmo oficial dos dois dígitos verificadores,
incluindo a regra de decremento (dsc = 2) quando o DV1 ultrapassa 9.
V.string().taxId(patterns: [const CnhPattern()]);
V.string().cnh(); // atalho
See also:
- VStringBr.cnh, o atalho pt-BR equivalente.
- RenavamPattern e PlacaPattern, os outros documentos de trânsito cobertos aqui.
Constructors
- CnhPattern()
-
Cria um CnhPattern.
const
Properties
Methods
-
matches(
String value) → bool -
Returns
trueifvalueis a valid tax ID for this pattern. -
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