From e0615a5b4fdc397ce82da7cbd6e05f49f59f19a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Adasiewicz?= Date: Thu, 26 Jan 2023 15:21:50 +0100 Subject: [PATCH] use .toFilePath instead --- .../attachment/handler/stream_attachment_handler_io.dart | 7 +++---- 1 file changed, 3 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 08f242de..268dbf15 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 @@ -123,10 +123,9 @@ class StreamAttachmentHandler extends StreamAttachmentHandlerBase { final tempDir = await getTemporaryDirectory(); final tempPath = Uri.file(tempDir.path, windows: CurrentPlatform.isWindows); - var tempFilePath = tempPath.resolve(fileName!).path; - if (CurrentPlatform.isWindows && tempFilePath.startsWith('/')) { - tempFilePath = tempFilePath.substring(1); - } + final tempFilePath = tempPath + .resolve(fileName!) + .toFilePath(windows: CurrentPlatform.isWindows); print(tempFilePath); final attachmentFileBytes = attachmentFile.bytes;