使用 flutter 安装时无法看到 Android/data 中的应用程序文件夹

nee*_*ena 5 file android-emulator flutter

Future get _localPath async {
final Directory directory = await getApplicationDocumentsDirectory();
return directory.path;
}

Future _createDirectory() async {
final String path = await _localPath;
final Directory directory = await Directory('$path/CapturedImages').create(recursive: true);
print("The directory $directory is created");
}
Run Code Online (Sandbox Code Playgroud)

D / EGL_emulation(14006):eglMakeCurrent:0xeaff6780:ver 3 1(tinfo 0xc942c8e0)I / flutter(14006):目录目录:'/data/user/0/quadauq.ffmpeg_examplebyneena/app_flutter/CapturedImages'创建D/EGL_emulation (14006):eglMakeCurrent:0xeafc6d40:版本3 1(tinfo 0xdf9af9b0)

显示成功,但我在 Andrid/data 中的任何位置都看不到应用程序文件夹或创建的文件夹 - 有人可以帮忙吗?

Lap*_*ona 4

您可以请求存储目录:

Future get _localPath async {
  final Directory directory = await getExternalStorageDirectory();
  return directory.path;
}
Run Code Online (Sandbox Code Playgroud)

而不是应用程序文档目录。

因此,您可以在其中看到创建的文件夹的应用程序Android/data/quadauq.ffmpeg_examplebyneena/files/CapturedImages