analyzeAndParseResponse function

Map<String, dynamic> analyzeAndParseResponse(
  1. Response response
)

Implementation

Map<String, dynamic> analyzeAndParseResponse(http.Response response) {
  if (response.statusCode == 200) return json.decode(response.body);

  throw SimpleError('Erro ao se conectar com o serviço ViaCEP');
}