decodeResponse<Value> method

Future<Response<Value?>> decodeResponse<Value>(
  1. Response<String?> response,
  2. Type responseType,
  3. bool responseIsList
)

Used to decode the response body before returning from an API call

Implementation

Future<Response<Value?>> decodeResponse<Value>(
    Response<String?> response, Type responseType, bool responseIsList) async {
  final converted =
      await converter?.decode(response, responseType, responseIsList) ??
          response;

  return converted as Response<Value?>;
}