From b6c662ee087965834149d7f34bddaac1a4ac2745 Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Tue, 27 Jun 2023 18:01:37 +0530 Subject: [PATCH] chore: fix deprecation Signed-off-by: xsahil03x --- .../handler/stream_attachment_handler_io.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/stream_chat_flutter/lib/src/attachment/handler/stream_attachment_handler_io.dart b/packages/stream_chat_flutter/lib/src/attachment/handler/stream_attachment_handler_io.dart index 0b04ee61..1df1b411 100644 --- a/packages/stream_chat_flutter/lib/src/attachment/handler/stream_attachment_handler_io.dart +++ b/packages/stream_chat_flutter/lib/src/attachment/handler/stream_attachment_handler_io.dart @@ -29,14 +29,16 @@ class StreamAttachmentHandlerDesktop extends StreamAttachmentHandler { options: options, ); - // Open the native file browser so the user can select the download path. - final path = await getSavePath(suggestedName: data.fileName); - - if (path == null) { + // Open the native file browser so the user can select the save location. + final saveLocation = await getSaveLocation(suggestedName: data.fileName); + if (saveLocation == null) { // Operation was canceled by the user. return null; } + // Get the path to the user's selected location. + final path = saveLocation.path; + // Create an XFile for proper file saving. final file = data.toXFile(path: path);