Giter VIP home page Giter VIP logo

flutter-correios's Introduction

flutter_correios

Fazer o rastreio de objetos enviados pelos CORREIOS e consultar CEP. Este pacote utiliza a API POSTMON

Usage

  dependencies:
     flutter:
        sdk: flutter
     flutter_correios:

Como rastrear um objeto

   
    // import 'package:flutter_correios/flutter_correios.dart';
    // import 'package:flutter_correios/model/objeto_rastreio.dart';
    
    
    final FlutterCorreios fc = FlutterCorreios();
    ObjetoRastreio objeto = await fc.fazerRastreio(codRastreio: "PT118988786BR");
    print("código do rastreio: ${objeto.codigo}");
    print("Serviço: ${objeto.servico}");
    for(Historico historico in objeto.historico){
      print("=>");
      print("   Data:"+historico.data);
      print("   Local:"+historico.local);
      print("   Situação:"+historico.situacao);
      print("   Detalhes:"+historico.detalhes);
      print("<=");
    }    

Como consultar um CEP

   
    // import 'package:flutter_correios/flutter_correios.dart';
    // import 'package:flutter_correios/model/resultado_cep.dart';
    
    
    final FlutterCorreios fc = FlutterCorreios();
    ResultadoCEP resultado = await fc.consultarCEP(cep: "72010010");
    print("bairro: ${resultado.bairro}");
    print("cidade: ${resultado.cidade}");
    print("estado: ${resultado.estado}");
    print("logradouro: ${resultado.logradouro}");
    print("   Estado Km2: ${resultado.estadoInfo.areaKm2}");
    print("   Estado IBGE: ${resultado.estadoInfo.codigoIBGE}");
    print("   Estado Nome: ${resultado.estadoInfo.nome}");
    print("   Cidade Km2: ${resultado.cidadeInfo.areaKm2}");
    print("   Cidade IBGE: ${resultado.cidadeInfo.codigoIBGE}");

flutter-correios's People

Contributors

diefferson avatar jpdroid avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.