brazil library
Function-oriented library for generating, validating and formatting Brazilian values such as CPF and CNPJ.
Constants
-
brazilianStates
→ const Map<
String, String> - Map with all brazilian states. The key is the acronym and the value the name.
Functions
-
formatCep(
String cep) → String - Format a brazilian CEP string.
-
formatCnpj(
String cnpj) → String - Format a brazilian CNPJ string.
-
formatCpf(
String cpf) → String - Format a brazilian CPF string.
-
generateCnpj(
{bool isFormatted = true}) → String - Generate a valid brazilian CNPJ.
-
generateCnpjVerificationDigit(
String input) → String - Generate one of the verification digits of a CNPJ. The verification digit is generated based on the length of the input.
-
generateCpf(
{bool isFormatted = true}) → String - Generate a valid brazilian CPF.
-
generateCpfVerificationDigit(
String input) → String - Generate one of the verification digits of a CPF. The verification digit is generated based on the length of the input.
-
getCepData(
String cep) → Future< ViaCepData> -
Returns a model containing CEP data from the ViaCEP Webservice.
Throws a
ViaCepException
if the CEP or response is not valid. -
validateCnpj(
String input) → bool - Verify if a brazilian CNPJ is valid.
-
validateCpf(
String input) → bool - Verify if a brazilian CPF is valid.