mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 13:05:11 +00:00
chore: Follow up android download dir
This commit is contained in:
parent
686a5764c2
commit
82bd96104a
1 changed files with 3 additions and 7 deletions
|
@ -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 a new issue