getParserResponse<T> method
Implementation
ParserResponse<T, E> getParserResponse<T>(ApiResponse<T>? response) {
if (response == null) {
return ParserResponseEntity(null, []);
} else {
if (response is ApiResponsePagination) {
return ParserResponseWithPaginationEntity(
response.data as T,
(response as ApiResponsePagination).pagination,
getErrors(response.errors ?? []),
);
} else {
return ParserResponseEntity(
response.data, getErrors(response.errors ?? []));
}
}
}