diff --git a/CHANGELOG.md b/CHANGELOG.md index cf85753..641a560 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.14.1 +- Atualiza README com `gerarCPF` e `gerarCNPJ`, por [adilsonjuniordev](https://github.com/adilsonjuniordev). + ## 1.14.0 - Novo formatter: `CNSInputFormatter()` diff --git a/README.md b/README.md index 863ad47..3f56105 100644 --- a/README.md +++ b/README.md @@ -112,8 +112,10 @@ A classe `UtilData` possui métodos que facilitam obter o valor de um objeto `Da A classe `UtilBrasilFields` possui métodos que facilitam obter os valores CEP, KM, CPF e CPNJ já formatados: -- `UtilBrasilFields.gerarCPF(bool? useFormat)` (Gera um CPF aleatório com ou sem formatação) -- `UtilBrasilFields.gerarCNPJ(bool? useFormat)` (Gera um CNPJ aleatório com ou sem formatação) +- `UtilBrasilFields.gerarCPF()` (XXX.XXX.XXX-XX) +- `UtilBrasilFields.gerarCPF(false)` (XXXXXXXXXXX) +- `UtilBrasilFields.gerarCNPJ()` (XX.YYY.ZZZ/NNNN-SS) +- `UtilBrasilFields.gerarCNPJ(false)` (XXYYYZZZNNNNSS) - `UtilBrasilFields.obterCpf('11122233344')` (111.222.333-44) - `UtilBrasilFields.obterCnpj('11222333444455')` (11.222.333/4444-55) - `UtilBrasilFields.obterCep('11222333')` (11.222-333) diff --git a/example/pubspec.lock b/example/pubspec.lock index c4f7ec2..12c7f35 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -44,10 +44,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" fake_async: dependency: transitive description: @@ -110,10 +110,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" path: dependency: transitive description: @@ -139,18 +139,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -171,10 +171,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" vector_math: dependency: transitive description: @@ -187,9 +187,9 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" diff --git a/lib/src/util/util_brasil_fields.dart b/lib/src/util/util_brasil_fields.dart index 9e92f75..2c33f56 100644 --- a/lib/src/util/util_brasil_fields.dart +++ b/lib/src/util/util_brasil_fields.dart @@ -76,11 +76,23 @@ class UtilBrasilFields { ///Faz a validação do CNPJ retornando `[true]` ou `[false]` static bool isCNPJValido(String? cnpj) => CNPJValidator.isValid(cnpj); - ///Gera um CPF aleatório + /// Gera um CPF aleatório + /// + /// Formatado ou não formatado, baseado no parâmetro `useFormat`: + /// + /// `true`: CPF gerado terá o formato `XXX.XXX.XXX-XX` + /// + /// `false`: CPF gerado terá o formato `XXXXXXXXXXX` static String gerarCPF({bool useFormat = false}) => CPFValidator.generate(useFormat: useFormat); - ///Gera um CNPJ aleatório + /// Gera um CNPJ aleatório + /// + /// Formatado ou não formatado, baseado no parâmetro `useFormat`: + /// + /// `true`: CNPJ gerado terá o formato `XX.YYY.ZZZ/NNNN-SS` + /// + /// `false`: CNPJ gerado terá o formato `XXYYYZZZNNNNSS` static String gerarCNPJ({bool useFormat = false}) => CNPJValidator.generate(useFormat: useFormat); diff --git a/pubspec.lock b/pubspec.lock index bd354e5..175071b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" fake_async: dependency: transitive description: @@ -103,10 +103,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" path: dependency: transitive description: @@ -132,18 +132,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -164,10 +164,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" vector_math: dependency: transitive description: @@ -180,9 +180,9 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 87bd61d..1de02be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: brasil_fields description: O jeito mais fácil de utilizar padrões e formatos brasileiros em seu projeto Dart. -version: 1.14.0 +version: 1.14.1 homepage: https://github.com/flutterbootcamp/brasil_fields repository: https://github.com/flutterbootcamp/brasil_fields issue_tracker: https://github.com/flutterbootcamp/brasil_fields/issues