cep_future 0.1.4

  • Readme
  • Changelog
  • Example
  • Installing
  • new50

cep_future 💌

Pub Build Status Coverage Status

Uma library para Dart que que efetua a busca de CEPs em diversos serviços. Fortemente inspirado no pacote CEP Promise

Features #

  • Sempre atualizado em tempo-real por se conectar diretamente aos serviços dos Correios e ViaCEP.

  • Possui alta disponibilidade por usar vários serviços como fallback.

  • Sempre retorna a resposta mais rápida por fazer as consultas de forma concorrente.

  • Sem limites de uso (rate limits) conhecidos.

Uso #

Um simples exemplo de uso:

import 'package:cep_future/cep_future.dart';

main() async {
    final result = await cepFuture('05653-070');

    print(result.city);
    print(result.cep);
    print(result.neighborhood);
    print(result.state);
    print(result.street);

    // or

    print(result.toJson());
    // {
    //     'cep': '05653070',
    //     'state': 'SP',
    //     'city': 'São Paulo',
    //     'street': 'Praça Roberto Gomes Pedrosa',
    //     'neighborhood': 'Jardim Leonor'
    // }
}

CHANGES #

0.1.4 #

Update promise race implementation

0.1.3 #

Increase Coverage

0.1.2 #

Add example

0.1.1 #

Small fixes

0.1.0 #

Add correios service support and .toJson method on result

0.0.2 #

Via cep support

0.0.1 #

Initial release. Relies on pre-released master.

example/main.dart

import 'package:cep_future/cep_future.dart';

Future<void> main() async {
  final result = await cepFuture('05653-070');

  print(result.city);
  print(result.cep);
  print(result.neighborhood);
  print(result.state);
  print(result.street);

  print(result.toJson());
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  cep_future: ^0.1.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:cep_future/cep_future.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

43 out of 43 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
http ^0.12.0+2 0.12.0+2
xml2json ^4.0.0 4.0.0
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.11 1.14.12
convert 2.1.1
http_parser 3.1.3
meta 1.1.7
path 1.6.4
pedantic 1.8.0+1
petitparser 2.4.0
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
xml 3.5.0
Dev dependencies
flutter_test