Skip to content

Commit

Permalink
fix: Added alternative to getExternalStorageDirectory for iOS (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikbaid3 authored Mar 10, 2021
1 parent aabce99 commit ff86e39
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/pages/downloads_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ class _DownloadsPageState extends State<DownloadsPage> {
}

_initFiles() async {
_homeDirectory = (await getExternalStorageDirectory()).path + '/';
if (Platform.isAndroid) {
_homeDirectory = (await getExternalStorageDirectory()).path + '/';
} else {
_homeDirectory = (await getApplicationDocumentsDirectory()).path + '/';
}
_directory = _homeDirectory;
_syncFiles();
}
Expand Down

0 comments on commit ff86e39

Please sign in to comment.