Не удается сохранить файл в каталог документов IOS Flutter
Я попробовал протестировать загрузку и сохранение файла в директорию с документами. Код работает на Android, но не работает на IOS. Вот код:
var dir = await getApplicationDocumentsDirectory();
var documentName = "";
documentName = "testname.pdf";
var storePath = "${dir.path}/$documentName";
var errorOccurred = false;
try {
await dio.download(url, storePath, onReceiveProgress: (rec, total) {
print("Rec: $rec , Total: $total");
_setState(() {
downloading = true;
progressString = ((rec / total) * 100).toStringAsFixed(0) + "%";
});
});
} catch (e) {
print(e);
}
Ошибка следующая:
Исключение: PlatformException(file_not_found, File not found: '/../Devices/3D122270-E919-455D-AF3F-F048EC32CBB7/data/Containers/Data/Application/1262A294-59DC-47A5-B5A6-24FBACHESTESTES/D53CA/.pdf', ноль, ноль)
Тестирую на симуляторе