brazillian 2.0.0 copy "brazillian: ^2.0.0" to clipboard
brazillian: ^2.0.0 copied to clipboard

A library to generate, validate and format Brazilian data, such as CPF, CNPJ, Phones, Currency and many other things.

example/brazillian.dart

library brazillian.example;

import 'package:brazillian/brazillian.dart';

main() {
  // [CPF]
  // Generate a valid CPF
  print(brazillian.cpf.generate());
  // Generate a invalid CPF
  print(brazillian.cpf.generate(invalid: true));
  // Generate a formatted CPF
  print(brazillian.cpf.generate(formatted: true));
  // Validates the generated CPF
  print(brazillian.cpf.isValid(brazillian.cpf.generate()));
  // Formats a generated CPF
  print(brazillian.cpf.format(brazillian.cpf.generate()));

  // [CNPJ]
  // Generate a valid CPF
  print(brazillian.cnpj.generate());
  // Generate a invalid CPF
  print(brazillian.cnpj.generate(invalid: true));
  // Generate a formatted CPF
  print(brazillian.cnpj.generate(formatted: true));
  // Validates the generated CPF
  print(brazillian.cnpj.isValid(brazillian.cnpj.generate()));
  // Formats a generated CPF
  print(brazillian.cnpj.format(brazillian.cnpj.generate()));
}
6
likes
140
pub points
66%
popularity

Publisher

unverified uploader

A library to generate, validate and format Brazilian data, such as CPF, CNPJ, Phones, Currency and many other things.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on brazillian