mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-05 19:49:29 +01:00
chore: Follow up android download dir
This commit is contained in:
parent
df91290a18
commit
0222e6ecd5
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user