use .toFilePath instead

This commit is contained in:
Rafał Adasiewicz
2023-01-26 15:21:50 +01:00
parent d9d6b3fe95
commit e0615a5b4f
@@ -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;