Response.fromClient constructor Null safety

Response.fromClient(
  1. HttpClientResponse clientResponse,
  2. dynamic body,
  3. {Map<String, dynamic>? originHeaders}
)

Maps the client response to Response

Implementation

factory Response.fromClient(HttpClientResponse clientResponse, body,
 {Map<String, dynamic>? originHeaders}) {
  return Response(
      request: Request(
        url: clientResponse.headers.host,
        body: body,
        headers: originHeaders,
      ),
      statusCode: clientResponse.statusCode,
      body: body,
      connectionInfo: clientResponse.connectionInfo,
      headers: clientResponse.headers);
}