fix(ui): temp file path on Windows

This commit is contained in:
Rafał Adasiewicz
2023-01-26 12:26:12 +01:00
parent 9b22eb9fd7
commit 6aafd8e5bc
2 changed files with 5 additions and 1 deletions
@@ -123,7 +123,10 @@ class StreamAttachmentHandler extends StreamAttachmentHandlerBase {
final tempDir = await getTemporaryDirectory();
final tempPath = Uri.file(tempDir.path, windows: CurrentPlatform.isWindows);
final tempFilePath = tempPath.resolve(fileName!).path;
var tempFilePath = tempPath.resolve(fileName!).path;
if (CurrentPlatform.isWindows && tempFilePath.startsWith('/')) {
tempFilePath = tempFilePath.substring(1);
}
print(tempFilePath);
final attachmentFileBytes = attachmentFile.bytes;