getImage method

Future<DynamiteResponse<Uint8List, void>> getImage({
  1. required String id,
  2. GetImageSize? size,
})

Get the main image of a recipe. If no image is stored a fallback image is delivered.

Returns a Future containing a DynamiteResponse with the status code, deserialized body and headers. Throws a DynamiteApiException if the API call does not return an expected status code.

Parameters:

  • id The id of the recipe to obtain the image for.
  • size The size of the requested image.
  • full - Full resolution image (size full res) * thumb - thumbnail of the image (size 250px) * thumb16 - icon of the image (size 16px). by default the full size image will be returned.

Status codes:

  • 200: Image was obtained and will be in response either as image/jpeg or image/svg+xml
  • 406: The recipe has no image whose MIME type matches the Accept header

See:

Implementation

Future<_i1.DynamiteResponse<Uint8List, void>> getImage({
  required String id,
  GetImageSize? size,
}) async {
  final _request = $getImage_Request(
    id: id,
    size: size,
  );
  final _streamedResponse = await _rootClient.httpClient.send(_request);
  final _response = await _i3.Response.fromStream(_streamedResponse);

  final _serializer = $getImage_Serializer();
  return _i1.ResponseConverter<Uint8List, void>(_serializer).convert(_response);
}