diff --git a/app/lib/ui/flow/media_preview/components/network_image_preview/network_image_preview_view_model.dart b/app/lib/ui/flow/media_preview/components/network_image_preview/network_image_preview_view_model.dart index 44e5a11..4f60eaf 100644 --- a/app/lib/ui/flow/media_preview/components/network_image_preview/network_image_preview_view_model.dart +++ b/app/lib/ui/flow/media_preview/components/network_image_preview/network_image_preview_view_model.dart @@ -90,8 +90,10 @@ class NetworkImagePreviewStateNotifier } @override - void dispose() { - tempFile?.deleteSync(); + Future dispose() async { + if (tempFile != null && await tempFile!.exists()) { + await tempFile!.delete(); + } cancelToken?.cancel(); super.dispose(); }