handleResponse method
dynamic
handleResponse(
- Response response
Implementation
dynamic handleResponse(http.Response response) {
if (response.statusCode < 300) {
return response.body.isNotEmpty ? json.decode(response.body) : response.body;
}
String? desc = json.decode(response.body)["message"];
throw Exception(desc ?? response.body);
}