+6
-4
@@ -29,14 +29,16 @@ class StreamAttachmentHandlerDesktop extends StreamAttachmentHandler {
|
|||||||
options: options,
|
options: options,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Open the native file browser so the user can select the download path.
|
// Open the native file browser so the user can select the save location.
|
||||||
final path = await getSavePath(suggestedName: data.fileName);
|
final saveLocation = await getSaveLocation(suggestedName: data.fileName);
|
||||||
|
if (saveLocation == null) {
|
||||||
if (path == null) {
|
|
||||||
// Operation was canceled by the user.
|
// Operation was canceled by the user.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the path to the user's selected location.
|
||||||
|
final path = saveLocation.path;
|
||||||
|
|
||||||
// Create an XFile for proper file saving.
|
// Create an XFile for proper file saving.
|
||||||
final file = data.toXFile(path: path);
|
final file = data.toXFile(path: path);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user