brasil_fields
Brazilian input formatting, validation, and data generation for Flutter
All Skills in This Repository (2)
Pure Emerald Level Indicatorsusing_brasil_fields
Format and validate Brazilian CPF, CNPJ, CEP, phone, currency, and date fields in Flutter.
contributing_brasil_fields
Guide contributions to the brasil_fields Flutter package with formatter and test guidelines.
Frequently Asked Questions
FAQPage SchemaHow to install brasil_fields?โผ
Run `npx skills add flutterbootcamp/brasil_fields --all -g -y` in your terminal to install all skills in this suite globally.
How to format CPF and CNPJ in Flutter?โผ
Add CpfInputFormatter or CnpjInputFormatter to your TextFormField's inputFormatters list along with FilteringTextInputFormatter.digitsOnly. The field formats user input in real time as they type.
How to validate a CPF or CNPJ in Dart?โผ
Call UtilBrasilFields.isCPFValido or UtilBrasilFields.isCNPJValido with the document string. Each method returns true only when the checksum digits are mathematically valid.
Does brasil_fields support the new 2026 CNPJ format?โผ
Yes. Use CnpjAlfanumericoInputFormatter for the new alphanumeric CNPJ format, and do not combine it with FilteringTextInputFormatter.digitsOnly.
Can I generate test CPF and CNPJ values?โผ
Yes. UtilBrasilFields.gerarCPF and UtilBrasilFields.gerarCNPJ return valid randomly generated documents, with or without punctuation, ideal for tests and mock data.
Related Repositories in Software Engineering
View All in Software Engineeringโopenclaw
Run a personal AI assistant across your devices and chat apps
superpowers
Gives coding agents a disciplined workflow from idea to merged code
react
AI agent skills for building, testing, and porting React core