Я пытаюсь загрузить файлы типа .png или .pdf из active-storage (rails backend) через dio. Каждый раз, когда я пытаюсь загрузить файлы, я получаю переполнение стека.
Вот мой код:
try {
var response = await dio.download(file.path, newFile.path,
onReceiveProgress: (received, total) {
if (total != -1) {
print((received / total * 100).toStringAsFixed(0) + "%");
}
}
);
} catch (e) {
print(e);
}