getPreview method
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:
filePath of the file. Defaults to''.xWidth of the preview. Defaults to44.yHeight of the preview. Defaults to44.versionVersion 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:
- getPreviewRaw for an experimental operation that returns a DynamiteRawResponse that can be serialized.
Implementation
Future<DynamiteResponse<Uint8List, void>> getPreview({
String? file,
int? x,
int? y,
String? version,
}) async {
final rawResponse = getPreviewRaw(
file: file,
x: x,
y: y,
version: version,
);
return rawResponse.future;
}