Future sharePDFDirectly() async {
await hasStoragePermissions();
String tempdirPath = await getdir();
var link = await connection.getPrescriptionLink(
checkinID: checkIn.checkinno,
);
print(
"sharePDFDirectly:: response in getPrescription: $link type:${link.runtimeType}");
// First send a message to the customer, so that the next step of sharing the pdf goes to the right recipient.
Dio dio = Dio();
String fpath = tempdirPath + "/prescription.pdf";
Response retData = await dio.download(link, fpath);
print("Downloaded prescription before sharing through Whatsapp to $fpath");
List<String> filePaths = [];
filePaths.add(fpath);
await WhatsappShare.shareFile(
text: 'Whatsapp share text',
phone: '91${customer.mobile}',
filePath: filePaths,
);
Getting this exception when trying to share files