getPreview method

Future<DynamiteResponse<Uint8List, void>> getPreview({
  1. String? file,
  2. int? x,
  3. int? y,
  4. String? version,
})

Get the preview for a file version.

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:

  • file Path of the file. Defaults to "".
  • x Width of the preview. Defaults to 44.
  • y Height of the preview. Defaults to 44.
  • version Version of the file to get the preview for. Defaults to "".

Status codes:

  • 200: Preview returned
  • 400: Getting preview is not possible
  • 404: Preview not found

See:

Implementation

Future<_i1.DynamiteResponse<Uint8List, void>> getPreview({
  String? file,
  int? x,
  int? y,
  String? version,
}) async {
  final _request = $getPreview_Request(
    file: file,
    x: x,
    y: y,
    version: version,
  );
  final _streamedResponse = await _rootClient.httpClient.send(_request);
  final _response = await _i3.Response.fromStream(_streamedResponse);

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