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:

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

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 _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);
}