getPreviewByFileId method
Future<DynamiteResponse<Uint8List, void> >
getPreviewByFileId({
- int? fileId,
- int? x,
- int? y,
- PreviewGetPreviewByFileIdA? a,
- PreviewGetPreviewByFileIdForceIcon? forceIcon,
- String? mode,
- PreviewGetPreviewByFileIdMimeFallback? mimeFallback,
Get a preview by file ID.
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:
fileId
ID of the file. Defaults to-1
.x
Width of the preview. Defaults to32
.y
Height of the preview. Defaults to32
.a
Whether to not crop the preview. Defaults to0
.forceIcon
Force returning an icon. Defaults to1
.mode
How to crop the image. Defaults tofill
.mimeFallback
Whether to fallback to the mime icon if no preview is available. Defaults to0
.
Status codes:
- 200: Preview returned
- 400: Getting preview is not possible
- 403: Getting preview is not allowed
- 404: Preview not found
- 303: Redirect to the mime icon url if mimeFallback is true
See:
- getPreviewByFileIdRaw for an experimental operation that returns a
DynamiteRawResponse
that can be serialized.
Implementation
Future<_i1.DynamiteResponse<Uint8List, void>> getPreviewByFileId({
int? fileId,
int? x,
int? y,
PreviewGetPreviewByFileIdA? a,
PreviewGetPreviewByFileIdForceIcon? forceIcon,
String? mode,
PreviewGetPreviewByFileIdMimeFallback? mimeFallback,
}) async {
final rawResponse = getPreviewByFileIdRaw(
fileId: fileId,
x: x,
y: y,
a: a,
forceIcon: forceIcon,
mode: mode,
mimeFallback: mimeFallback,
);
return rawResponse.future;
}