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:
key
Key of the image.useSvg
Return image as SVG. Defaults to1
.
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
Response
from 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 _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);
}