Skip to content

Commit 7904fd3

Browse files
committed
KB file modified
1 parent e072384 commit 7904fd3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

lib/helper/save_file_mobile_desktop.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@ Future<void> saveAndLaunchFile(List<int> bytes, String fileName) async {
1414
Platform.isIOS ||
1515
Platform.isLinux ||
1616
Platform.isWindows) {
17-
final Directory directory =
18-
await path_provider.getApplicationSupportDirectory();
19-
path = directory.path;
17+
if (Platform.isAndroid) {
18+
final Directory? directory =
19+
await path_provider.getExternalStorageDirectory();
20+
if (Platform.isAndroid && directory != null) {
21+
path = directory.path;
22+
}
23+
} else {
24+
final Directory directory =
25+
await path_provider.getApplicationSupportDirectory();
26+
path = directory.path;
27+
}
2028
} else {
2129
path = await path_provider_interface.PathProviderPlatform.instance
2230
.getApplicationSupportPath();

0 commit comments

Comments
 (0)