使用 flutter 安装时在 Android/data 中看不到应用程序文件夹

Cannot see application folder in Android/data while installing with 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");
}

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

显示成功,但我在 Andrid/data 中的任何地方都看不到应用程序文件夹或创建的文件夹 - 谁能帮忙?

您可以请求存储目录:

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

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

因此,您可以在Android/data/quadauq.ffmpeg_examplebyneena/files/CapturedImages

中看到创建的文件夹的应用程序