var tempDir = await getTemporaryDirectory();
String fullPath = "${tempDir.path}/boo2.pdf'";
print('full path $fullPath');
File file = File(fullPath);
if (await file.exists() && Platform.isAndroid)
{
} else {
download2(dio, imgUrl, fullPath);
}
Above code is used to download pdf file in flutter. If file exist in device then it should directly open it. and if it is not then it should download. Now the problem is I dont know how to open exist pdf.
2
Answers
Most simple solution would be to use open_filex
this will help you : open_file: ^3.2.1
this is the link : https://pub.dev/packages/open_file
you can open pdf by using this