update viewer impl

This commit is contained in:
Anton Stubenbord
2024-01-12 22:24:08 +01:00
parent 9bca1cb6ed
commit 49ed8f43b6
12 changed files with 486 additions and 106 deletions

View File

@@ -28,7 +28,7 @@ abstract class PaperlessDocumentsApi {
String getThumbnailUrl(int docId);
Future<Uint8List> downloadDocument(int id, {bool original});
Future<void> downloadToFile(
DocumentModel document,
int id,
String localFilePath, {
bool original = false,
void Function(double progress)? onProgressChanged,

View File

@@ -223,14 +223,14 @@ class PaperlessDocumentsApiImpl implements PaperlessDocumentsApi {
@override
Future<void> downloadToFile(
DocumentModel document,
int id,
String localFilePath, {
bool original = false,
void Function(double)? onProgressChanged,
}) async {
try {
final response = await client.download(
"/api/documents/${document.id}/download/",
"/api/documents/$id/download/",
localFilePath,
onReceiveProgress: (count, total) =>
onProgressChanged?.call(count / total),