getImage method
Future<DynamiteResponse<Uint8List, void> >
getImage({
- required String key,
- 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:
useSvgReturn image as SVG. Defaults to1.keyKey of the image.
Status codes:
- 200: Image returned
- 404: Image not found
- 500
See:
- $getImage_Request for the request send by this method.
- $getImage_Serializer for a converter to parse the
Responsefrom an executed request.
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);
}