I want to download a binary file which is PDF and save it into my device. The file comes from API response. My response.body is like this:
Here is my code:
void downloadFile() async {
String url = Uri.encodeFull('https://API_URL');
http.Response response = await http.post(url, headers: {"Accept": "application/json", HttpHeaders.authorizationHeader: 'Bearer '},});
print(response.body);
}
How can I use response.body to download the PDF file?
