mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-06 03:59:28 +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 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -55,12 +54,9 @@ extension MatrixFileExtension on MatrixFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<Directory> getDownloadDirectoryAndroid() async {
|
Future<Directory> getDownloadDirectoryAndroid() async {
|
||||||
final downloadDirectories = await getExternalStorageDirectories(
|
final defaultDownloadDirectory = Directory('/storage/emulated/0/Download');
|
||||||
type: StorageDirectory.downloads,
|
if (await defaultDownloadDirectory.exists()) {
|
||||||
);
|
return defaultDownloadDirectory;
|
||||||
if (downloadDirectories != null && downloadDirectories.isNotEmpty) {
|
|
||||||
inspect(downloadDirectories);
|
|
||||||
return downloadDirectories.first;
|
|
||||||
}
|
}
|
||||||
return await getApplicationDocumentsDirectory();
|
return await getApplicationDocumentsDirectory();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user