chore: Follow up android download dir

This commit is contained in:
Krille 2023-03-19 09:03:56 +01:00
parent df91290a18
commit 0222e6ecd5
No known key found for this signature in database

View File

@ -1,4 +1,3 @@
import 'dart:developer';
import 'dart:io';
import 'package:flutter/material.dart';
@ -55,12 +54,9 @@ extension MatrixFileExtension on MatrixFile {
}
Future<Directory> getDownloadDirectoryAndroid() async {
final downloadDirectories = await getExternalStorageDirectories(
type: StorageDirectory.downloads,
);
if (downloadDirectories != null && downloadDirectories.isNotEmpty) {
inspect(downloadDirectories);
return downloadDirectories.first;
final defaultDownloadDirectory = Directory('/storage/emulated/0/Download');
if (await defaultDownloadDirectory.exists()) {
return defaultDownloadDirectory;
}
return await getApplicationDocumentsDirectory();
}