cpf_util 3.0.1 copy "cpf_util: ^3.0.1" to clipboard
cpf_util: ^3.0.1 copied to clipboard

A Dart package to generate, validate and format Brazilian's CPF in an easy way

CPF Util #

A Dart package to generate, validate and format Brazilian's CPF in an easy way.

style: effective dart GitHub repo size Project Owner GitHub stars GitHub forks

Use cases #

You can validate data in a TextField, or even format it without any effort, inside a Flutter application.

Also, you can generate valid CPFs, for testing purposes.

Usage #

void main() {
  final cpf = CPFUtil();

  // This will generate 100 valid CPF
  for (int i = 0; i < 100; i++) {
    print(cpf.generate());
  }

  // This will validate a given CPF (Must be a String)
  print(cpf.validate('352.753.028-27')); // -> true

  // This will format a given CPF (Must be a String)
  print(cpf.format('35275302827')); // -> 352.753.028-27
}
3
likes
140
pub points
66%
popularity

Publisher

unverified uploader

A Dart package to generate, validate and format Brazilian's CPF in an easy way

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

meta

More

Packages that depend on cpf_util