mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-05 19:49:29 +01:00
chore: Follow up download android
This commit is contained in:
parent
57618417a1
commit
df91290a18
@ -1,3 +1,4 @@
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@ -49,14 +50,19 @@ extension MatrixFileExtension on MatrixFile {
|
||||
}
|
||||
|
||||
Future<String> getDownloadPathAndroid() async {
|
||||
final directory = await getDownloadDirectoryAndroid();
|
||||
return '${directory.path}/$name';
|
||||
}
|
||||
|
||||
Future<Directory> getDownloadDirectoryAndroid() async {
|
||||
final downloadDirectories = await getExternalStorageDirectories(
|
||||
type: StorageDirectory.downloads,
|
||||
);
|
||||
if (downloadDirectories != null && downloadDirectories.isNotEmpty) {
|
||||
return downloadDirectories.first.path;
|
||||
inspect(downloadDirectories);
|
||||
return downloadDirectories.first;
|
||||
}
|
||||
final fallbackDirectory = await getApplicationDocumentsDirectory();
|
||||
return fallbackDirectory.path;
|
||||
return await getApplicationDocumentsDirectory();
|
||||
}
|
||||
|
||||
FileType get filePickerFileType {
|
||||
|
Loading…
Reference in New Issue
Block a user