mapSingleResponse<T extends Model> method
SingleResponse<T>
mapSingleResponse<T extends Model>(
- Response response
inherited
Implementation
SingleResponse<T> mapSingleResponse<T extends Model>(
Response<dynamic> response) {
if ((response.statusCode ?? 0) <= 204) {
return SingleResponse<T>.fromJson(response.data);
} else {
throw ServerException.fromResponse(
json.encode(response.data), response.statusCode);
}
}