|
|
@ -15,7 +15,9 @@ extension MatrixFileExtension on MatrixFile {
|
|
|
|
final fileName = name.split('/').last;
|
|
|
|
final fileName = name.split('/').last;
|
|
|
|
if (PlatformInfos.isMobile) {
|
|
|
|
if (PlatformInfos.isMobile) {
|
|
|
|
final tmpDirectory = PlatformInfos.isAndroid
|
|
|
|
final tmpDirectory = PlatformInfos.isAndroid
|
|
|
|
? Directory('/storage/emulated/0/Download/')
|
|
|
|
? (await getExternalStorageDirectories(
|
|
|
|
|
|
|
|
type: StorageDirectory.downloads))
|
|
|
|
|
|
|
|
.first
|
|
|
|
: await getTemporaryDirectory();
|
|
|
|
: await getTemporaryDirectory();
|
|
|
|
final path = '${tmpDirectory.path}$fileName';
|
|
|
|
final path = '${tmpDirectory.path}$fileName';
|
|
|
|
await File(path).writeAsBytes(bytes);
|
|
|
|
await File(path).writeAsBytes(bytes);
|
|
|
|