pngResponse static method

Response pngResponse({
  1. BaseRequest? request,
})

Return a response containing a PNG image.

Implementation

static Response pngResponse({BaseRequest? request}) {
  final headers = {
    'content-type': 'image/png',
    'content-length': '${_pngImageData.length}'
  };

  return Response.bytes(_pngImageData, 200,
      request: request, headers: headers, reasonPhrase: 'OK');
}