From 818857261d2b7dc5de5c02d69922b64be7732940 Mon Sep 17 00:00:00 2001 From: NBA2K1 <78034913+NBA2K1@users.noreply.github.com> Date: Sat, 7 Dec 2024 03:54:23 +0100 Subject: [PATCH] Windows PathNotFoundException fix - Fixed the PathNotFoundException for Windows, which doesn't use "/" in directories, but "\". (flutter: PathNotFoundException: Creation failed, path = 'C:\Users\User\AppData\Local\Temp\Mangayomi/cacheimagecover' (OS Error: Das System kann den angegebenen Pfad nicht finden.) Instead of manually concatenating paths using string interpolation, it now uses the join function properly. - Also fixed that the App was not able to create the directories by including recursive: true in the else statement. --- lib/modules/widgets/custom_extended_image_provider.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/modules/widgets/custom_extended_image_provider.dart b/lib/modules/widgets/custom_extended_image_provider.dart index bafd1d7..df20458 100644 --- a/lib/modules/widgets/custom_extended_image_provider.dart +++ b/lib/modules/widgets/custom_extended_image_provider.dart @@ -192,7 +192,8 @@ class CustomExtendedNetworkImageProvider ) async { final Directory cacheImagesDirectory = Directory(join( (await getTemporaryDirectory()).path, - 'Mangayomi/${imageCacheFolderName ?? "cacheimagecover"}')); + 'Mangayomi', + imageCacheFolderName ?? 'cacheimagecover')); Uint8List? data; // exist, try to find cache image file if (cacheImagesDirectory.existsSync()) { @@ -213,7 +214,7 @@ class CustomExtendedNetworkImageProvider } // create folder else { - await cacheImagesDirectory.create(); + await cacheImagesDirectory.create(recursive: true); } // load from network if (data == null) {