search_cep 2.0.1+1 copy "search_cep: ^2.0.1+1" to clipboard
search_cep: ^2.0.1+1 copied to clipboard

outdated

Pacote para facilitar e agilizar a comunicação com a API via_cep e obter informações sobre CEPs e localidades de todo o Brasil

example/example.dart

import 'package:search_cep/search_cep.dart';
import 'package:search_cep/src/postmon/postmon_search_cep.dart';

void main() async {
  final infoCepJSON = await ViaCepSearchCep.searchInfoByCep(cep: '01001000');
  final infoCepJSON2 = await ViaCepSearchCep.searchInfoByCep(cep: '99999999');
  final infoCepJSON3 = await ViaCepSearchCep.searchInfoByCep(cep: '12345');
  final infoCepJSON4 = await ViaCepSearchCep.searchInfoByCep(cep: '30000000');

  final infoCepXML = await ViaCepSearchCep.searchInfoByCep(
      cep: '01001000', returnType: ReturnType.xml);
  final infoCepXML2 = await ViaCepSearchCep.searchInfoByCep(
      cep: '99999999', returnType: ReturnType.xml);

  final infoCepPiped = await ViaCepSearchCep.searchInfoByCep(
      cep: '01001000', returnType: ReturnType.piped);
  final infoCepPiped2 = await ViaCepSearchCep.searchInfoByCep(
      cep: '99999999', returnType: ReturnType.piped);

  final infoCepQuerty = await ViaCepSearchCep.searchInfoByCep(
      cep: '01001000', returnType: ReturnType.querty);
  final infoCepQuerty2 = await ViaCepSearchCep.searchInfoByCep(
      cep: '99999999', returnType: ReturnType.querty);

  final cepsJSON = await ViaCepSearchCep.searchForCeps(
      uf: 'RS',
      cidade: 'Porto Alegre',
      logradouro: 'Domingos',
      returnType: ReturnType.json);
  final cepsXML = await ViaCepSearchCep.searchForCeps(
      uf: 'RS',
      cidade: 'Porto Alegre',
      logradouro: 'Domingos',
      returnType: ReturnType.xml);

  final postmonInfo = await PostmonSearchCep.searchInfoByCep(cep: '60175020');
  final postmonError = await PostmonSearchCep.searchInfoByCep(cep: '000');

  print(infoCepJSON);
  print(infoCepJSON2.searchCepError);
  print(infoCepJSON3.searchCepError);
  print(infoCepJSON4);

  print(infoCepXML);
  print(infoCepXML2.searchCepError);
  print(infoCepPiped);
  print(infoCepPiped2.searchCepError);
  print(infoCepQuerty);
  print(infoCepQuerty2.searchCepError);
  print(cepsJSON);
  print(cepsXML);

  print(postmonInfo);
  print(postmonError);
}
60
likes
40
pub points
92%
popularity

Publisher

verified publisherrodrigobastos.dev

Pacote para facilitar e agilizar a comunicação com a API via_cep e obter informações sobre CEPs e localidades de todo o Brasil

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter, http, xml2json

More

Packages that depend on search_cep