Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter pdf文件未显示在我的内部存储器中| flatter_Flutter_Dart_Pdf_Path - Fatal编程技术网

Flutter pdf文件未显示在我的内部存储器中| flatter

Flutter pdf文件未显示在我的内部存储器中| flatter,flutter,dart,pdf,path,Flutter,Dart,Pdf,Path,我在应用程序中生成了一个pdf文件,我想将该文件存储到我的本地目录。我编写了一个保存函数。但该文件没有显示在我的内部存储中。当我打印存储位置时,它显示为“/storage/emulated/0/Android/data/com.example.pdf\u generate/files”。当我进入应用程序目录时,无法获取该文件 Future savePdf() async { Directory documentDirectory = await getExternalStorageDirect

我在应用程序中生成了一个pdf文件,我想将该文件存储到我的本地目录。我编写了一个保存函数。但该文件没有显示在我的内部存储中。当我打印存储位置时,它显示为“/storage/emulated/0/Android/data/com.example.pdf\u generate/files”。当我进入应用程序目录时,无法获取该文件

Future savePdf() async {
 Directory documentDirectory = await getExternalStorageDirectory();

 String documentPath = documentDirectory.path;
 print(documentPath);

 File file = File("$documentPath/example.pdf");

 file.writeAsBytesSync(await pdf.save());
}
这是代码,我尝试了getApplicationDocumentsDirectory和getDownloadsDirectory