cpf_cnpj_validator
2.0.0, released 6 years ago by an unverified publisher
Validate, format, strip and generate Brazilian CPF and CNPJ numbers.
What it does
Provides utility classes to validate, format, strip, and generate Brazilian CPF and CNPJ identification numbers. It supports both raw and formatted string inputs with customizable stripping behavior.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to validate user input for Brazilian CPF or CNPJ documents in forms.
- You need to format raw CPF/CNPJ strings or strip formatting characters.
- You need to generate random valid CPF or CNPJ numbers for testing or placeholders.
Skip it when
- Your application does not deal with Brazilian tax or identification numbers.
Strengths
- Simple and straightforward static API methods.
- Supports both validation and generation of CPF and CNPJ.
- Null safety supported in version 2.0.0.
Weaknesses
- Limited in scope strictly to Brazilian CPF/CNPJ numbers.
- No built-in UI form field widgets provided out of the box.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
import 'package:cpf_cnpj_validator/cpf_validator.dart';
bool isValid = CPFValidator.isValid("334.616.710-02");
String formatted = CPFValidator.format("33461671002");Alternatives
Packages that do the same job and could replace cpf_cnpj_validator.
- all_validations_br
Complete Flutter toolkit for Brazilian validations, form masks, logging, and cryptography.
67Compare - intl_phone_number_input
A Flutter widget for inputting international phone numbers with country code selectors.
63Compare - br_validators
Validation functions and input masks for common Brazilian documents and data.
58Compare - credit_card_validator
Validates credit card numbers, expiration dates, and CVVs based on card type.
50Compare