From 744fbf87f51aefa012ccc8162c05dfcfd45111d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Tue, 13 Jan 2026 23:16:25 +0100 Subject: [PATCH] Refactor blob creation in file download to enhance readability --- b0esche_cloud/lib/pages/file_explorer.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/b0esche_cloud/lib/pages/file_explorer.dart b/b0esche_cloud/lib/pages/file_explorer.dart index d85f893..b0b23d1 100644 --- a/b0esche_cloud/lib/pages/file_explorer.dart +++ b/b0esche_cloud/lib/pages/file_explorer.dart @@ -354,7 +354,9 @@ class _FileExplorerState extends State { final bytes = response.bodyBytes; final blob = web.Blob( [bytes.toJS].toJS, - web.BlobPropertyBag(type: response.headers['content-type'] ?? 'application/octet-stream'), + web.BlobPropertyBag( + type: response.headers['content-type'] ?? 'application/octet-stream', + ), ); final blobUrl = web.URL.createObjectURL(blob); @@ -365,7 +367,7 @@ class _FileExplorerState extends State { ..style.display = 'none'; web.document.body?.appendChild(anchor); anchor.click(); - + // Cleanup web.document.body?.removeChild(anchor); web.URL.revokeObjectURL(blobUrl);