getImage method

Future<DynamiteResponse<Uint8List, void>> getImage({
  1. required String key,
  2. ThemingGetImageUseSvg? useSvg,
})

Get an image.

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:

  • useSvg Return image as SVG. Defaults to 1.
  • key Key of the image.

Status codes:

  • 200: Image returned
  • 404: Image not found
  • 500

See:

Implementation

Future<_i1.DynamiteResponse<Uint8List, void>> getImage({
  required String key,
  ThemingGetImageUseSvg? useSvg,
}) async {
  final _request = $getImage_Request(
    key: key,
    useSvg: useSvg,
  );
  final _response = await _rootClient.httpClient.send(_request);

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