cpf_util 1.0.3
cpf_util: ^1.0.3

Dart native js
Flutter Android iOS web

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
}
2
likes
110
pub points
16%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

lemozxpedro@gmail.com

License

BSD (LICENSE)

More

Packages that depend on cpf_util