From 0222e6ecd59c83ce426a7212597011b4a08fc00b Mon Sep 17 00:00:00 2001 From: Krille Date: Sun, 19 Mar 2023 09:03:56 +0100 Subject: [PATCH] chore: Follow up android download dir --- .../matrix_sdk_extensions/matrix_file_extension.dart | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/utils/matrix_sdk_extensions/matrix_file_extension.dart b/lib/utils/matrix_sdk_extensions/matrix_file_extension.dart index 7e3b46cf..7dd35374 100644 --- a/lib/utils/matrix_sdk_extensions/matrix_file_extension.dart +++ b/lib/utils/matrix_sdk_extensions/matrix_file_extension.dart @@ -1,4 +1,3 @@ -import 'dart:developer'; import 'dart:io'; import 'package:flutter/material.dart'; @@ -55,12 +54,9 @@ extension MatrixFileExtension on MatrixFile { } Future 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(); }