fromResponse method
Implementation
IpStackResponse fromResponse(http.Response response) {
if (response.statusCode == 200) {
final jsonBody = json.decode(response.body);
return IpStackResponse.fromJson(jsonBody);
} else {
throw "Invalid response from ipstack: status=${response.statusCode}, body=${response.body}";
}
}