flutterbootcampflutterbootcampOfficialยท2 Agent Skills Included

brasil_fields

Brazilian input formatting, validation, and data generation for Flutter

Formats Brazilian data like CPF, CNPJ, CEP, phone numbers, currency, and dates directly inside Flutter text fields. Validates document checksums and generates mock CPF or CNPJ values without writing custom parsing logic. Provides ready-made lists of states, months, and regions to speed up form building and eliminate manual string manipulation.
npx skills add flutterbootcamp/brasil_fields --all -g -y

All Skills in This Repository (2)

Pure Emerald Level Indicators

Frequently Asked Questions

FAQPage Schema
How 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โ†’